[En-Nut-Discussion] Problem with CPU clock freq computation

Waschk,Kolja enut at ixo.de
Wed Feb 11 13:20:42 CET 2004


Hi

On a selfmade board similar to the Ethernut 1, I experience a weird effect
involving NutComputeCpuClock(). The computed cpu_clock is 12287200 Hz, which
is almost exactly 5/6 of 14,745600 MHz. Actually we use a 14,7456 MHz crystal.

The clock crystal has the usual 32,768 kHz.

Measurements proved that the actual clocks ARE 14,745600 MHz resp. 32,768 kHz.

Then, e.g. UART baud rate is only correctly set up if CPU clock freq of
14,7456 MHz was hardcoded (e.g. using -DNUT_CPU_FREQ=14745600).

Did anyone had some similar effect in the past and has an explanation for me?

Fuses of the m128 are set to 0xFF 0x03 0x3F, i.e. longest startup time.
Pausing the m128 just before NutComputeCpuClock (via JTAG) doesn't have any
effect on the outcome of the computation. It always yields 12287200.

I'm using gcc 3.3.2, BTW. The most "visible" difference to the Ethernut 1.3F
is that we're using a 32,768 kHz crystal in SMD package. But as I said above,
the actual clock looks correct when measured with external equipment.

Thanks for hints in advance
Kolja

-- 
mr. kolja waschk - haubach-39 - 22765 hh - ger
phone +49 40 889130-34 - fax -35 - e-mail s.a.




More information about the En-Nut-Discussion mailing list