> Older AVRs had the problem, if a the voltage dropped under the limit > during a eeprom write, adr 0 was corrupted as well as the one written. > > But current AVRs -- at least with the brown out detector enabled -- does > not show this bug anymore...
If you look at the EEPROM Address Register in the data sheets you can tell which parts will corrupt address zero. If EEAR shows the initial value as 0x00 then address zero and possibly the one being written will be corrupted. Newer parts show the initial value as "undefined", these will not corrupt address zero (unless it was really address zero being written when power falls fast). What happens is that when power fall is detected the internal address is reset to zero, but the EEPROM state-machine is not reset and will always try to complete the write cycle. Depends on how fast power gets to low for the EEPROM state-machine to complete its work, and exactly when the power fall is detected verses the EEPROM state-machine current state, determines what gets corrupted. Since the newer parts don't change EEAR on power fall they no longer corrupt address zero. You could still have the address being written corrupted if power falls fast, as with any EEPROM technology. Might be worth adding to the FAQ. _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list