I make project counting object , I use eeprom to store data when reset board start counting from where i have left from the previous count but i'm worry because i use it to store data 300 time in day ,I don't know if the repeating of store data in eeprom will make problem in long time because i read There is a limited number of write cycles available for eeprom and i want to know if it safe or not &if i use SD card ,Is it better than eeprom or not ? & if SD card better ,How i save data with address ?

Flash memory usually allow about 10'000 write operations. The EEPROM allows about 100'000 write cycles till it gets unreliable. An SD card has the same restrictions but there you have an intelligent controller on the card reordering the write operations in a way that the blocks written to change in every write operation. This way you can use an SD card more like a hard drive but the limitations still apply.

If your project includes an RTC use the nonvolatile RAM they offer because that memory area can be written as many times as you like.

Flash memory usually allow about 10'000 write operations. The EEPROM allows about 100'000 write cycles till it gets unreliable. An SD card has the same restrictions but there you have an intelligent controller on the card reordering the write operations in a way that the blocks written to change in every write operation. This way you can use an SD card more like a hard drive but the limitations still apply.

If your project includes an RTC use the nonvolatile RAM they offer because that memory area can be written as many times as you like.

yes i have RTC in my project to show date and time for each object but i can't understand you in this point (

Quote

RTC use the nonvolatile RAM they offer because that memory area can be written as many times as you like

I use RTC (http://tronixstuff.wordpress.com/2010/05/28/lets-make-an-arduino-real-time-clock-shield/) in my project with RTC library to save date and Time i don,t know the code to save count values into it , can help me with simple code ?

I make project counting object , I use eeprom to store data when reset board start counting from where i have left from the previous count but i'm worry because i use it to store data 300 time in day ,I don't know if the repeating of store data in eeprom will make problem in long time because i read There is a limited number of write cycles available for eeprom and i want to know if it safe or not &if i use SD card ,Is it better than eeprom or not ? & if SD card better ,How i save data with address ?

Thanks

You'll have to work out how to store the count, how many times it needs to be updated and what the reliable storage life will be. An approach which others have suggest in the past is to use multiple EEPROM storage locations, advancing to the next location when the number of updates to the current location exceeds the safe limit. For example you could store a counter in the first two bytes of EEPROM which you use to count from 0 .. 50,000; when it reaches 50,000 you leave it and start counting 0 .. 50,000 again in the next two bytes, and so on for as long as necessary. To get the instantaneous value you simply walk through the EEPROM reading two-byte pairs and accumulate them until you reach a terminating marker; the last cell before the marker is the entry that needs to be incremented to update the stored value.

Another approach that was suggested was to put a capacitor on the input supply that allowed the Arduino to continue running briefly after power was removed - just long enough to flush the current counter from RAM to EEPROM. That way the EEPROM update only needed to be performed once per power cycle so wear was not a problem.

I only provide help via the forum - please do not contact me for private consultancy.

Another approach to EEPROM limits is to use a ring memory, you can then shift around the ring periodically spreading the read/write operations over several addresses. Here's a snippet where I create a 20-byte ring (starting at byte 20 of the EEPROM) during setup using one additional byte (in byte 0) to store the current address of where by data is stored. The data's location shifts around the ring once each time the sketch is started. Here, I am storing 1 byte of data and my worst case guess is that it will be read ten times and written 210 times each day, while the processor will be re-started about 10 times a day. Thus, the byte where the data address is stored will be reliable for 100000/10 days, or 27+ years, and the ring will last 100000*20/220 days, or about 25 years. If your data updates more frequently, you need a bigger ring, and if you need more than 254 cells, your address will need to be stored in 2 bytes instead of 1. (The Serial.print statements are there just so that I can see what happens at startup; they will be gone in actual use. The ring doesn't start at byte 1, but at byte 20, because I will use the low bytes to index other rings.)

I use RTC (http://tronixstuff.wordpress.com/2010/05/28/lets-make-an-arduino-real-time-clock-shield/) in my project with RTC library to save date and Time i don,t know the code to save count values into it , can help me with simple code ?

This is how I save a position (two integer values) into the non-volatile RAM of the DS1307: