Tech Support > Computer Hardware > Microprocessors > Atmega Internal clock source accuracy
Atmega Internal clock source accuracy
Posted by eeh on August 31st, 2005


Hi,

I find that Atmega internal 1MHz RC clock source is inaccurate. It is
about 95% of 1MHz. I used 3V.

I have tried to check the oscillator calibration byte by AVRStudio and
then load the value into OSCCAL in the beginning of the program.
However, the problem is still present.

Could anyone tell me how to calibrate under this condition?

Posted by larwe on August 31st, 2005



The internal RC source varies across V and T.

You don't need to do this for the 1MHz value (usually, it depends on
the specific chip). The 1MHz cal byte is loaded automatically at
powerup.


Posted by eeh on August 31st, 2005


The freqency accuracy is so large even the clock value is calibrated. I
find that it is about 5% which is so large for measurement purpose
applications.

Posted by Hans-Bernhard Broeker on August 31st, 2005


eeh <eehobbyist@yahoo.com.hk> wrote:
Quite certainly. So don't use it if you need an accurate clock. Use
what the gods intended for the purpose: a quartz or something even
better, external tot he CPU.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.

Posted by eeh on August 31st, 2005


Thanks!

Posted by Tom Twist on August 31st, 2005


On 31 Aug 2005 04:03:27 -0700, "larwe" <larwe@larwe.com> wrote:

The problem is that you use 3V.
The nominal internal RC frequency is for 5V.

The OP didn't say what device he is using, but I looked at the ATmega8
datasheet, and at shows in Fig 180 that you should indeed get about
0.95MHz at 3V, 25 °C

You could use AVRStudio to calibrate, or just try loading higher
values for OSCCAL in your program.

You can expect +/- 1% accuracy, but it highly depends on the voltage
and temperature. If needed, you can adjust OSCCAL at runtime, but do
not change the frequency by more than 2% at a time.

The most recent devices, like ATtiny2313 and ATmega48/88/168 has a
clock output option, so you can measure the frequency directly.

There is also an application note,
AVR053: Calibration of the internal RC oscillator
http://atmel.com/dyn/resources/prod_...ts/doc2555.pdf
and the corresponding code files
http://atmel.com/dyn/resources/prod_...nts/AVR053.zip

Tom


Posted by Rene Tschaggelar on September 1st, 2005


eeh wrote:

Yes, the RC clock is there for application
that can tolerate this margin. There are
ceramic resonators giving better accuracy
and stability and there are quartz cristals
that give even better values. What is the
problem ? Oh, you wanted to save another
dollar.

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com
& commercial newsgroups - http://www.talkto.net


Similar Posts