1

I will implements an emergency backup feature before power off, on Arduino Mega 2650. Arduino is powered by capacitor, for the time (I hope) of the EEPROM write.

On AVR2650 Datasheet is reported that the typical EEPROM writing time is 3.3ms. But 3.3ms for what? a byte? a word? the whole EEPROM?

I need the data for calculate the capacitors.

2

On AVR2650 Datasheet is reported that the typical EEPROM writing time is 3.3ms. But 3.3ms for what? a byte? a word? the whole EEPROM?

That is per byte (erase and write 3.4 ms, only write is 1.8 ms). When writing multiple bytes there are a few clock cycles to be gained by preparing for the next byte during an ongoing EEPROM write. Or even better use an ISR for the EEPROM feed. Not faster but allows some additional processing while a block is written. The largest gain is to have the EEPROM erased before the write (1.8 ms per byte instead of 3.4 ms).

Please see http://www.nongnu.org/avr-libc/user-manual/group__avr__eeprom.html, http://www.atmel.com/images/doc2578.pdf and table 9-1, pp. 35, http://www.atmel.com/Images/Atmel-2549-8-bit-AVR-Microcontroller-ATmega640-1280-1281-2560-2561_datasheet.pdf.

Cheers!

  • Re “largest gain is to have the EEPROM erased before the write”, note that AVR-level eeprom.h includes a comment, “All write functions force erase_and_write programming mode”, so having EEPROM erased before the write entails coding EEPROM routines from scratch. ¶ To some extent, separating erase and write precludes possible time savings from not rewriting cells with unchanged value. – James Waldby - jwpat7 Mar 15 '17 at 15:53
  • The ATmega2560 needs 4.5V to run at 16MHz. Newer chips allow a lower voltage and also write faster to EEPROM. How many bytes do you need to write ? Arduino has a function to skip the bytes that are the same: arduino.cc/en/Reference/EEPROMUpdate Perhaps there are things that you can do in software, to prepare for an emergency backup. When storing data in EEPROM, you could write it with a checksum, and have the data two times in EEPROM. – Jot Mar 16 '17 at 12:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.