Haha, I've got to agree, I don't think it will be too happy with 20000 writes.. but I'm curious, what is it that you need to store in your EEPROM?
Have you looked into external EEPROMS? (Just for the sake of saving your arduino) They're VERY cheap, and often have more space than the Arduino. (And by cheap, I mean like $2 a chip.)
I believe I read in the data sheet that it offers a minimum of 100,000 writes for EEPROM, and 10,000 for flash.
So the minimum it will last, is about 5 days. There's a very good chance you'll get quite a bit more writes than it says.
But again, I'm curious on what you need to write this often, there should be a better way to handle this. Considering you will probably overwrite what you previously saved.
I'm sure somebody else can offer some more detailed information, I've only worked with the onboard EEPROM a few times.
Best of luck! Hopefully some of this helps.. if it's not all useless information:D
yeah this is the dirty solution that comes in my mind for this problem:
-i send to arduino every 30 seconds via ethernet 5 colors (24bit each one)
-arduino process this color and light up 5 different led array with the sended color
now, the entire system is powered by a 5v / 25Watt power supply.
When i swich off a swicher the entire system light down (the arduino too, since is plugged directly to the 5v rail)
Now, i would like that when i swich on the switcher the system automaticly lightup with the same color that it had before the switch down.
The optimal solution is listening with transistor and a capacitor, when the power is turn out, then in few millisecond (while the capacitor still power up the arduino) store the entire information..
but i haven't enought experience on prepearing this setup, so actually i donno how to..
btw now that i know that the eeprom is writeble "only" 100k times, i must come back and find another better solution
haha "only" 100,000.. well at your rate, that would be no good!
Ah, I see your issue.. well, do you know when you'll be turning off the switch every time? You could have a button for saving the data before you turn off the switch. (Not really.. practical, but best I can come up with, haha.) Or your idea.. (just re-read the post)
You could look into a super-cap, not sure it would work in this situation.. but I've heard of them being used for when powering down, it'll save information. Reading the value of the Supercap, and if it drops below a certain value (powering down, but still has power) with a big enough resistor after the cap, you MAY (this is just an idea..) be able to have enough time to save the data. And only have it save data when the cap drops below.. say a value of 500?
Super caps generally act as a battery, just doesn't have the same time usage as batteries.
But I'm sure there is a much easier solution, just gotta hope for that person with more experience in this specific area.
100000 writes ticking every 30secs is ~34 days not 5. Anyway...
The life of the chip is 100.000 cycles for each eeprom cell.
You could burn some cells but not the entire chip doing that.
since you are only saving 15bytes every time, you can write your code so that it cycles writing throughout the entire address range of the chip, and not rewrite on the same cells over and over again.
328 has 1024 bytes, so you can have roughly 1024/15 writes before your chip comes one tick closer to being toast, bringing its life to (1024/15)*100.000 writes for your project which would be enough for roughly 2370 days .
Of course as the guys said above, you can use an external eeprom and do the same thing. And after the 6-7 years that it will take to toast it, just through it away and plug in a new one.
Will your project even survive that long?
100000 writes ticking every 30secs is ~34 days not 5. Anyway...
I was tired.. leave me alone.
I didn't think about the SD card.. but it still seems like there would be an easier way to do what he's looking for when it powers down.
I didn't realize it was for each "cell", I haven't used EEPROM much, so that makes alot more sense. I just kind of figured when the program writes to any cell, that would be considered a write for the whole EEPROM in total. shrug
But on Practical Arduino, I seen that he was using a Thumb Drive with some kind of chip.. but he can read/write/check disk space... everything a normal computer would do, and it's not limited to the 1GB flash drives. So you could store a LOT of data, and compare it over time.. he doesn't have the code up, I'm afraid you're going to have to wait for the book, but take a look: http://www.practicalarduino.com/news/id/371
It uses Serial connection to provide all the functions.
I can't wait for their book.. pre-ordering that on Amazon, they have some SWEET projects they plan on putting in the book.
ok just to let you all know ..
my project will last forever
now, the main problem is not about how long a cell last, since looks like there are some minor problem we don't take in consideration ( for exemple what happen when a cell is damaged? what kind of result it gives to an read() command? MTBF(mean time before failure) is set to 100.000 but as usuall we don't know when exactly it happens, and even if i decide to take as a standard number the HALF of that value, it still not sure). And also, looks like a not initialized cell have a B(11111111) = 255 value, this is a little bit oddish for me, since 255 is also a valid value i can storage.
So back to the topic, is not about how big my storage will be, but when i'm going to write to it, and to fix this issue we must find a smart way on writing data only when we need to storage it!
i'm sure that my project is just an exemple, but how many out there have more or less the same problem? i think lots
so will be great to find and discovered a good way to implement this, and why not, there are lots of electronics out there that have a "soft shutdown system", will be cool if there will be on a future release of arduino, or just as an additional shield, something like this.
the atmel use around 25mA (if i don't remember bad) @3.3v when it's on delay (standby), so will be cool if there something that can throw an interuption and start a "save routine" when a less voltage is sensing on the usual power port (on the same time, a capacitor, with off course a big resistence, can provide a 5second additional power).
Exactly. And if it detects a different value than the one it saved just a tick ago, it can light a red led or something to signal you that you have dead cells.
The question is what will you do with the saved data?
Do you really need to save it on eeprom? Can t you just save it on a global variable stored in RAM? Do you need to read it from an external device?
And how critical would be to not lose any data in case of power failure?
I am planning on designing something similar to detect battery voltage drop and set the avr on some power saving mode to protect its software RTC. My guess is that it should be really easy using an analog I/O port to read the voltage via some kind of divider or something.
Just to be a bit pedantic it is not the number ow writes that is the limiting factor but the number of erases. This means that for one byte you could write 8 times a 1 to a zero before you have used that go.
And also, looks like a not initialized cell have a B(11111111) = 255 value, this is a little bit oddish for me, since 255 is also a valid value i can storage.
But it would be exactly the same if the eprom erased to zeros, that is still a valid value. Welcome to the world of binary bits.