AVR-Chat@yahoogroups.com wrote: > Hi Tim, > > As I understand it, the chip only loads the osccal value for > it's lowest internal oscillator speed (1MHz usually). You > have to write a different value to the OSCCAL register for > running at faster oscillator speeds. > > Also remember that the oscillator cal byte will be wrong if > your not using the supply voltage your meant to use. (Usually 5V) > > The way ive done this in the past when not using the correct > voltage is I go into a loop that outputs the osccal value to > the serial port, I then incriment the osccal value and keep > outputting it until I can read the value in my terminal > program. When you can read the values, pick one in the middle > of the bunch and it will be accurate enough. > Thanks... The 1MHz thing is true for most of the megas but the mega162 seems to be a bit of an oddity in that the RC oscillator is fixed at 8MHz. You can then divide it down to a lower speed if you want using the CLKPS3..0 bits. I am using 5V supply, but according to the graphs in the data sheet, it should be pretty much dead on over the whole voltage range. Even at 85 degrees C it should be closer than it was for me. -- Tim Mitchell tim@sabretechnology.co.uk http://www.sabretechnology.co.uk
Message
RE: [AVR-Chat] Re: Mega162 RC oscillator way off calibration
2006-07-05 by Tim Mitchell
Attachments
- No local attachments were found for this message.