The Arduino specs a 100,000 write/erase cycle, is this per address or total?
What I am wondering if I can write to an address, read what was just written and check it to see if the byte matches, if not then assume that address dead and move to the next address to write the data. Effectivly giveing me 100,000*512=51,200,000 write cycles.
Is there other ways to preserve data in case of power loss?
Can the Arduino write to a SD card? Found some post on this and reading them now, anything more improved?
I think that number is per address. Not sure what the failure modes are, so the test you mention may not be a good one (e.g., failure mode may be that the value is there for a few minutes, or hours, etc).
SD has an SPI interface mode, so you can use an SD card as an SPI flash device. This acts like a chunk of flash, no FAT filesystem and pop it in a computer type support unless you write it.
There are also external flash devices from various manufacturers.
If you're worried about device failure due to excessive write cycles, check out the Ramtron FRAM devices. Their claim is more than 1014 write cycles. At a glance price is comparable to other flash devices. I'm currently looking at them because of the speed and instant writes - no need to wait between writes.
Thanks all for the info.
I did some calculations and not sure if I even need to worry about it.
Even if I needed to write 10 times a day, that is 3650 times per year so 100,000/3650 = 27 years!
Basicly what I need to do is write the data only if power is lost, and only if different from what has previously been writen. Which brings me to another questions, what can you sggest to use as "power backup" that will provide enough power to give time for the write?
I figure I can use a digi input to detect main power lose, when the pin goes low - write the data. So I would need a cap or something to provide enough power. Somthing like the battery on a mainboard comes to mind.