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?

asked May 14, 2015 at 16:57
1
  • 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? Commented May 21, 2015 at 21:25

2 Answers 2

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.

answered May 14, 2015 at 17:15
8
  • Do you know how the Arduino IDE handles this? There are zero user options there. Commented May 14, 2015 at 18:04
  • @JorisGroosman: It doesn't. You'll need to use avrdude and ISP in order to read or manipulate the fuses. Commented May 14, 2015 at 18:07
  • So the IDE erases the EEPROM? I would say this explicitly in your answer, it seems important. Commented May 14, 2015 at 18:10
  • @JorisGroosman: It erases the EEPROM if the EESAVE fuse isn't programmed. Commented May 14, 2015 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. Commented May 15, 2015 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.

answered Sep 3, 2016 at 15:55

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.