John Boxall (tronixstuff) wanted to know just how long the EEPROM in an ATMega328 would last, so he whipped up this neat test program to stress the memory. He writes:
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.

Printable catalog (PDF)
FEED
What if it was an Atmel inside a hot device instead?
Comment by ad — May 10, 2011 @ 4:13 pm
Good point, Ad.
Additional thermal stress would almost certainly shorten the lifespan.
Comment by johngineer — May 10, 2011 @ 4:20 pm
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.
Comment by makomk — May 10, 2011 @ 4:53 pm
So then how many licks does it take to get to the center of a ATMega328?
I never made it without Byteing.
XD
Comment by Kevin G — May 10, 2011 @ 6:42 pm
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.
Comment by Matias — May 10, 2011 @ 9:58 pm
Yep, it was on a Microchip pic datasheet. Really don’t know about atmel, sorry
Comment by Matias — May 10, 2011 @ 10:04 pm
@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.
Comment by johngineer — May 10, 2011 @ 10:05 pm
@Kevin G: Nice!
Comment by Chris S. — May 10, 2011 @ 10:29 pm