Monday, May 6, 2013

Atmel Fuses and Tuning

(edit: I found this post stuck in draft mode, and decided to post it as-is for reference).

If you need to control your Atmel chip startup behaviour, you probably want to set the fuse bits. It's a little like burning eeprom settings; these don't get overwritten unless you mean to (or you hit the 'burn bootloader' in the IDE, even if no bootloader gets sent to the AT Tiny...)

First, check out the fuse values that you want here ... fuses are basically three bytes of data (low, high, extended):

http://www.engbedded.com/fusecalc

And then either edit boards.txt, or just do it at the command line with avrdude... start with this tutorial.

For a serial-GPS to AT 84 gadget I'm building I'd like to set 8Mhz, internal oscillator, and no clock/8, so that means the low fuse byte is going to be 'E2', the high fuse is 'DF', and the extended fuse is 'FF'. For some reason that isn't clear to me yet the unused bits in the extended fuse are read inverted by avrdude, so it might be read as '01'.

You might notice that I set the chip to use it's own slightly less than accurate internal oscillator. I'm cheap, and I don't need 16Mhz for this project (yet!) so 8Mhz is fine, but I'm also relying on sort-of-accurate timing because both the serial side and the I2C side of the communications are not implemented in hardware in the AT 84, but software, so it's probably safer to set the calibration before I end up troubleshooting what I suspect is bad comm wiring, when it's really bad timing.

How to do this? Tiny Tuner!

http://arduino.cc/forum/index.php/topic,8553.0.html




No comments:

Post a Comment