avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Determine CPU clock frequency


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Determine CPU clock frequency
Date: Mon, 13 Mar 2006 11:59:38 +0100 (MET)

(Please use a subject line!  Please don't send HTML mails.)

"Gary Taylor" <address@hidden> wrote:

> Does anyone have a way (in firmware) to determine what crystal is
> connect= ed to a ATmega128 ?  I have 2 x different versions of
> product in the field with 2 x different = crystal values, and need
> to main the same code in both versions.

You need some reference in order to do this.  If you've got a 32 kHz
async crystal attached, that would of course be the easiest way.

If both clocks differ very much, you could perhaps try to use the
EEPROM write timing as a reference.  The EEPROM is specified to use
8448 cycles of the 1 MHz RC oscillator for a write operation.

Finally, there's the obvious thing to do: if you've got two differen
hardware revisions, use two different hardware IDs (like through pin
strapping, or through some kind of serial number).

-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]