EEPROM ?

I have a basic question about EEPROM. It says in the reference tab of the arduino site "An EEPROM write takes 3.3 ms to complete. The EEPROM memory has a specified life of 100,000 write/erase cycles, so you may need to be careful about how often you write to it." can someone tell me what this means? does it mean that i can only write it 100, 000 times and then i have to replace my arduio chip or i can't write to it anymore? i am using the arduino uno chip.

Yes I think if you write +/- 100000 times to the same place then it will start to fail reading from / writing to that place.

Just to be clear.

The EEPROM referred to on that page is for the program-accessible EEPROM. That is so your sketch can store data when power is lost.

That information does not refer to the Flash memory used to store the program code.

The flash memory only has a tenth of the endurance of the EEPROM...

student238:
I have a basic question about EEPROM. It says in the reference tab of the arduino site "An EEPROM write takes 3.3 ms to complete. The EEPROM memory has a specified life of 100,000 write/erase cycles, so you may need to be careful about how often you write to it." can someone tell me what this means? does it mean that i can only write it 100, 000 times and then i have to replace my arduio chip or i can't write to it anymore? i am using the arduino uno chip.

Imagine a FET (field effect transistor). Apply a charge to the gate and the FET conducts.

Now, imagine a memory cell (one bit) consisting of a FET, but no direct connection to the gate (there is an insulator layer between the gate terminal and the junction itself).

So, applying a "normal" charge to the gate terminal will do nothing because it's blocked by an insulator.

But, put a higher voltage (say 12, 15 even 21 volts) on that gate and a charge (electrons) will "tunnel" through the insulator and fill up the region between the FET junction and the gate.

Now the FET is conducting. Remove the "high" voltage and the charge stays trapped. The FET always conducts.

You have just programmed one EEPROM cell from logical 1 to logical 0.

The chip can run on 3.3 volts or 5.0 volts and self program because it has a built in CHARGE PUMP that generates the high programming voltage.

Now imagine a large array of these FETS... says 16384 of them (a 128 x 128 matrix). You now have a 2K by 8 bit memory matrix.

To change the programming of the EEPROM, the charge in each cell you wish to change must be removed, (making that byte all 0xFF), then program the appropriate zeros to store the new pattern.

To erase the floating gate, you need either to expose the chip to ionizing radiation (a short wave UV lamp) - (EPROM), or apply a "high" opposite charge to the cell to "draw out" the stored electrons (making the FET stop conduction). This is an EEPROM (EE=Electrically Erasable). Then a new pattern of zeros can be programmed in.

The problem is, forcing electrons back and forth through the insulating layer gradually damages it at the atomic level. It's insulation qualities deteriorate and eventually (after, say, 100,000 cycles) the insulator "leaks" enough that a programmed zero drains out and returns the cell to a logic one. At this point the EEPROM is ruined (won't hold data anymore). The data literally "leaks out" and the chip eventually returns to all 0xFF.

Hope this answers your question.

I have also covered this issue in my blog together with some rudimentary wear leveling code: Wear Leveling | Blinkenlight.

Well, I thought that it would be good to present the info in an easy to understand form. Too many times a student is drowned in arcane mathematics and unexplained things like "Fowler-Nordheim electron tunneling" and comes away from the lesson with nothing but a headache.

Way too many "teachers" and professors know the material, but are awful TEACHERS. A good TEACHER does whatever it takes to get the idea UNDERSTOOD by the student.

I like to teach in a way that is easy to understand, then when the basic idea is understood, THEN present the math and "higher level" facts that go along with it.

I didn't mention wear leveling simply because I didn't want to over-complicate what I wrote. New concepts are hard enough for some to grasp without making it even more confusing.

AFTER the student grasps the idea of trapped charges and the deterioration of the gate insulator, THEN the need for wear leveling can be introduced.

On another note... I once had an OTP (one time programmable) 68HC11 MCU that I screwed up (burned the wrong code into). So I figured I would test the EEPROM to destruction and wrote a little loop that just kept writing 0x55 and 0xAA to each byte, then switching the pattern (with a full erase after each write).

After running for WEEKS straight and many tens of millions of cycles, the EEPROM was still good!

I don't know if the EEPROM was damaged (and may have leaked away in a few days or weeks), but the programming time for a byte never changed and there was never a read-back error.

I think manufacturers are way conservative when they publish EEPROM cell write life numbers......

If its really a concern, adding an external FRAM can provide a lot more nonvolatile storage space, is fast to write to like an SRAM, has EEPROM dataholding capability, and "High Endurance 100 Trillion (1014) Read/Writes"!
http://www.mouser.com/ProductDetail/Ramtron/FM25W256-G/?qs=sGAEpiMZZMtsPi73Z94q0IidxlBy6KhxDctIlbo1eg0%3D

Can operate fom 5V also, not just 3.3V.
http://www.ramtron.com/files/datasheets/FM25W256_ds.pdf

Amazing, 256kb of fast and long lasting non-volatile memory! It is the first time I hear about FRAM (or FeRAM) and I am very impressed!

Is there an FRAM shield commercially available? and if not why do we not see such products offered?

On another note... I once had an OTP (one time programmable) 68HC11 MCU that I screwed up (burned the wrong code into). So I figured I would test the EEPROM to destruction and wrote a little loop that just kept writing 0x55 and 0xAA to each byte, then switching the pattern (with a full erase after each write).

After running for WEEKS straight and many tens of millions of cycles, the EEPROM was still good!

I don't know if the EEPROM was damaged (and may have leaked away in a few days or weeks), but the programming time for a byte never changed and there was never a read-back error.

Obviously you did not read my blog. Otherwise you would know that your experiment was pointless. EEPROM damage shows up in decreased retention time. Typically a cell is considered damaged if the threshhold (usually something in the range of years) can not be guaranteed anymore. You tested for retention times in the seconds / minutes range. This does not provide any insights whatsoever into remaining retention capabilities.

Krupski:
I think manufacturers are way conservative when they publish EEPROM cell write life numbers......

I've worn an arduino EEPROM out.

I made a battery tester that discharged batteries and timed them. It constantly wrote the time to EEPROM so I could fiddle with the software and upload new versions without the Arduino forgetting how long the current battery had been discharging.

I forgot to take the EEPROM code out when it was finished the battery tester sat on my bench for a couple of months and I'd stick batteries in it every now and again to see what sort of shape they were in.

And about six months later I re-used the Arduino. I was trying to use the EEPROM and failing. It took me all afternoon to figure out I'd wrecked the EEPROM with my battery tester. Luckily it was only the first six bytes, the rest was OK.

FRAM shield - here's one I started, got tied up and haven't actually routed it yet.
Want to replace the shift register with an open drain part for 3.3V operation,
and surface mount Rs & Cs.
Guess I need to change the packages to SMD also, since the parts are not available as DIPs.

FRAM and Due compatible! Great shield, hope you find the time to finish it!

If FRAM is indeed as good as it sounds, I hope we start using it instead of EEPROM before long.

TI has some uPs with FRAM. They sent out a booklet on using it recently.

CrossRoads:
FRAM shield - here's one I started, got tied up and haven't actually routed it yet.
Want to replace the shift register with an open drain part for 3.3V operation,
and surface mount Rs & Cs.
Guess I need to change the packages to SMD also, since the parts are not available as DIPs.

I've used parallel FRAM devices (RAMTRON FM1808) in 68HC11 controller projects. They are great. Completely non-volatile, low power, SRAM write speed and never wear out.

Solid state disk drives would be the ultimate use for FRAM if they weren't so large (silicon-wise) and so expensive relative to flash.

BTW, what do you need the shift register for? There are serial FRAM chips you know.... http://www.ramtron.com/products/nonvolatile-memory/serial.aspx

Shift registers - my thinking is that user picks a device by shifting 0 into appropriate device - then when D10 goes low, the selected device's CS would go low with it.
So 1 SPI.transfer with D9 as SS to select a particular chip, all 32K of SPI.transfers with D10 as SS to talk to the selected chip.
Will be a relatively pricey shield. 32K x 8 chip is $5.77 in low qty.

Maybe this is the way to go instead:
http://www.mouser.com/ProductDetail/Ramtron/FM25H20-G/?qs=sGAEpiMZZMtsPi73Z94q0Aq2gzGh5dgr6t94LzqSy9c%3D
256K x 8, same capacity as 8 of 32K x 8 chips, yet 1/2 the cost - $21.92 vs (8 X $5.77) = $46.16, makes it worthwhile to drop into 3.3V territory and add TXB0106 or HC4050 for level translation.
Or move down to 2V even
http://www.mouser.com/ProductDetail/Ramtron/FM25V20-G/?qs=sGAEpiMZZMtsPi73Z94q0IidxlBy6Khx%2FS3YolskXIk%3D
another $6 lower, add 2V regulator.
Then a 2M x 8 board could be had for $14.06 * 8 = $112 in memory, plus shift register, level translator, and 2V regulator.
Or whatever increment one wanted to populate at.