Some time ago I published a short tutorial concerning the use of the internal EEPROM belonging to the Atmel ATmega328 (etc.) microcontroller in our various Arduino boards. Although making use of the EEPROM is certainly useful, it has a theoretical finite lifespan – according to the Atmel data sheet (download .pdf) it is 100,000 write/erase cycles.
One of my twitter followers asked me “is that 100,000 uses per address, or the entire EEPROM?” – a very good question. So in the name of wanton destruction I have devised a simple way to answer the question of EEPROM lifespan. We will write the number 170 (10101010 in binary) to each EEPROM address, then read each EEPROM address to check the stored number. The process is then repeated by writing the number 85 (01010101 in binary) to each address and then checking it again. The two binary numbers were chosen to ensure each bit in an address has an equal number of state changes.
After both of the processes listed above has completed, then the whole lot repeats. The process is halted when an incorrectly stored number is read from the EEPROM – the first failure. At this point the number of cycles, start and end time data are shown on the LCD.
The result? 1,230,163 write/read cycles (per address) before failure. That’s an order of magnitude+ beyond Atmel’s specs, though Atmel does tend to be conservative with their numbers.
Adafruit has had paid day off for voting for our team for years, if you need help getting that going for your organization, let us know – we can share how and why we did this as well as the good results. Here are some resources for voting by mail, voting in person, and some NY resources for our NY based teams as well. If there are additional resources to add, please let us know – adafruit.com/vote
Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.
Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !
What if it was an Atmel inside a hot device instead?
Good point, Ad.
Additional thermal stress would almost certainly shorten the lifespan.
Yeah, it may well be that it’s rated for 100,000 cycles at temperatures near the top of its specced operating range. Also, there’s a catch: at least some types of EEPROM and Flash can apparently appear to write successfully, but then lose the data. I suspect the algorithm this uses may avoid that problem, but I’m not sure.
So then how many licks does it take to get to the center of a ATMega328?
I never made it without Byteing.
I think I readed somewhere that flash memory has like 100,000 r/w cycles, and eeprom memory like 1,000,000 r/w cycles before they start with problems.
Yep, it was on a Microchip pic datasheet. Really don’t know about atmel, sorry 🙂
@Matias: That’s probably closer to reality, as John’s experiment demonstrated, but the official Atmel specs are 10,000 write/erase cycles for flash and 100,000 for EEPROM. Reads are presumably unlimited.
Like I mentioned in the post, Atmel is probably being very conservative with those numbers.