How accurate are delays within loops

Ben1234:
I will not cross post in the future.

What exactly does the EEPROM "die" after 100,000 writes? I am only trying to store about 100 points which would theoretically be 2.5 seconds at 40 values per second. Afterwards I would upload them to the computer and wipe the old values. Any suggestions of a better way to do this? It was mentioned to me to instead use an SD card. If that is a good idea do you know of any tutorials or threads that you could point me in the direction of. Thanks.

A great site that tells you all about it:

http://www.lostcircuits.com/mambo//index.php?option=com_content&task=view&id=69&Itemid=1&limit=1&limitstart=3

The important bit from it:

...cycling a NAND flash cell entails extremely high electrical fields that can exceed 10 million volts per cm, which is needed to force the electrons to pass through the oxide layer in either direction. Over time, this causes degradation of the oxide layer by causing atomic bonds to break within the oxide layer proper and also at its interfaces with the floating gate and the substrate. The intermediate result is trapping of electrons at the broken bond sites with the oxide layer acquiring negative electrical charges. As a consequence, the erase process becomes slower whereas the programming becomes faster.

Wear levelling is most commonly used to get around the problem - the more cells there are for you to write to, the more you can write before the whole thing becomes unusable.

The great thing with an SD card over the internal EEPROM is that a) the SD card is replaceable so can be swapped when it begins to die, and b) is considerably bigger than the internal EEPROM, so has many millions more cells for you to play with, so you have many millions times more lifetime from it. Most SD cards include their own wear levelling systems, so you can just forget about it and it does it for you.

There are plenty of tutorials and examples around for using an SD card with the Arduino. Check the Examples within the IDE for a start.

Oh, and one tip - don't write your data points direct to EEPROM/SD/Whatever. Collate them in RAM first, and then write them after the sampling has been done together in one batch.