flash_the_atmega
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
flash_the_atmega [2013/10/05 11:37] – breaker27 | flash_the_atmega [2023/03/01 19:40] (current) – [Using flash scripts] breaker27 | ||
---|---|---|---|
Line 3: | Line 3: | ||
You can either take a pre-built firmware package from [[http:// | You can either take a pre-built firmware package from [[http:// | ||
- | ====== | + | ====== |
Every microcontroller has three parts that can be flashed (written): | Every microcontroller has three parts that can be flashed (written): | ||
Line 11: | Line 11: | ||
* The **EEPROM memory** contains (firmware) configuration data. It is also written to by the device in normal operation. It can we overwritten about 100.000 times. | * The **EEPROM memory** contains (firmware) configuration data. It is also written to by the device in normal operation. It can we overwritten about 100.000 times. | ||
- | **In general, it's a good idea to only flash what you need to, because the limited amount of possible write cycles.** | + | {{danger.gif}} |
====== Programming fuses ====== | ====== Programming fuses ====== | ||
Line 35: | Line 35: | ||
(replace ?? by the hex value for the needed fuse settings and use " | (replace ?? by the hex value for the needed fuse settings and use " | ||
- | ====== Flashing the firmware====== | + | ===== Strange avrdude error messages ===== |
+ | |||
+ | Some fuses only use a part of their bits. If you set such a fuse, avrdude may complain at verification that it read out another value than it wrote. | ||
+ | |||
+ | Writing the EFuse of the ATMega168 or 328 returns a value of only the last 3 bits (upper 5 unused), so a value of xxxxxyyy is read out as 00000yyy. Example: | ||
+ | |||
+ | < | ||
+ | avrdude: verification error, first mismatch at byte 0x0000 | ||
+ | 0xfc != 0x04 | ||
+ | avrdude: verification error; content mismatch | ||
+ | </ | ||
+ | |||
+ | Don't worry. The warning is only returned because avrdude does not know that the upper 5 bits are always 1 (as per spec). | ||
+ | |||
+ | ====== Flashing the firmware | ||
===== Using flash scripts ===== | ===== Using flash scripts ===== | ||
Line 43: | Line 57: | ||
* **flash.cmd** / **flash.sh** for flashing firmware, eeprom and fuses | * **flash.cmd** / **flash.sh** for flashing firmware, eeprom and fuses | ||
* **flash_firmware.cmd** / **flash_firmware.sh** for flashing only the firmware | * **flash_firmware.cmd** / **flash_firmware.sh** for flashing only the firmware | ||
- | * FIXME: The Linux scripts do not exist yet. | ||
===== Using a make rule ===== | ===== Using a make rule ===== |
flash_the_atmega.1380965877.txt.gz · Last modified: 2013/10/05 11:37 by breaker27