4

If I use EEPROM.write(someAddr, someValue) to write a value to an address, how long will that value "stick" to that address before being lost?

If I were to power down the Arduino, flash a whole new program to it, and power it on, could I still retrieve that old/cached value written from the previous program?

  • I am also interested in a technical answer to your first paragraph. Do you not have an Arduino to perform the test in the second paragraph yourself? – linhartr22 May 21 '15 at 21:25
2

Only if the EESAVE fuse is programmed (it is unprogrammed by default). If not then the EEPROM will be erased when a chip erase command is performed.

  • Do you know how the Arduino IDE handles this? There are zero user options there. – Joris Groosman May 14 '15 at 18:04
  • @JorisGroosman: It doesn't. You'll need to use avrdude and ISP in order to read or manipulate the fuses. – Ignacio Vazquez-Abrams May 14 '15 at 18:07
  • So the IDE erases the EEPROM? I would say this explicitly in your answer, it seems important. – Joris Groosman May 14 '15 at 18:10
  • @JorisGroosman: It erases the EEPROM if the EESAVE fuse isn't programmed. – Ignacio Vazquez-Abrams May 14 '15 at 18:17
  • 1
    I have couple of Unos, all of them keep eeprom content betweem flashing and I did not do anything with fuses. – Michal Foksa May 15 '15 at 12:51
0

how long will that value "stick" to that address before being lost?

The Atmega328 data retention is guaranteed by Atmel (the manufacturer) for 20 years at 85 degrees Celsius, 100 years at 25 degrees Celsius. Beware cheap Chinese clones usually use counterfeits chips, meaning those values are not going to be guaranteed any more

If I were to power down the Arduino, flash a whole new program to it, and power it on, could I still retrieve that old/cached value written from the previous program?

While @ignacio answer is more detailed I believe you are interested in plain Arduino IDE programming along with standard Arduino boards, in which case the answer is yes, the data is not going to be erased.

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.