I am currently working on one embedded project in which I have one counter which will be active all the time. If the power goes down then also I have to store last counter status and load it back in next startup. So that I was planning to use EEPROM in which I will continuously write my counter value. But I have read somewhere that EEPROM has read/write endurance at about 100,000 and I will be updating that counter probably 120,000 per 24 hours. So I am finding alternatives to accomplish this task. please give me your suggestion for doing the same.
Another solution could be to use a microcontroller with non-volatile FRAM. FRAM doesn't suffer from the same limitations on write cycles as EEPROM.
Some of the MSP430 products from TI are available with FRAM, here's a link to an application similar to what you describe:
Here's the Wikipedia article on FRAM: FRAM
I have this issue in a current project.
The way I'm dealing with it is to keep the live value of the counter in RAM. I added a little bit of hardware so that the microcontroller can detect that the raw input power voltage is low. If so, it stops what it's doing, saves the live counter value in EEPROM, then waits watching the raw power voltage. If it goes back up, with some hysteresis, then the micro essentially restarts. Otherwise, if power continues to go down, the micro will eventually get stopped. On the next restart, the counter value is loaded from EEPROM, then used live in RAM again until the next power-down.
It doesn't take long to write a small value to EEPROM. Most likely your existing power supply system has enough energy storage that you can detect the voltage going low, and still have enough guaranteed run time before power to the micro goes below the operating or EEPROM write threshold.
In my case, the only additional hardware was a Schottky diode to prevent the DC power supply from sucking charge from the local reservoir on the way down, and two resistors as a voltage divider so that the micro can read the raw input voltage. The rest is firmware.
It's important to note that you should be watching the voltage on the input to whatever final supply powers the micro, not the micro's power voltage directly. By the time the latter goes low, it may be too late. Hopefully there is a voltage range that is below the worst case when everything is operating correctly, and above what the micro's power supply needs to guarantee regulated voltage to the micro. In my case, the micro's supply was a buck regulator fed from 48 V, so there is a large range that is below normal but where the micro can still operate reliably.
Old old old solution, cmos counter + lithium battery or Ram + lithium battery.
The power supply for the storage element comes from the normal power supply when it is available or the battery when it is not.
A lot of modern micros in sleep will maintain their state with a very low current supply. So you can use this technique with power down detect to go to sleep then use a battery to maintain state during the sleep period while the main supply is off.
Microchip has a series of I2C "EERAM" parts which will allow data to be stored in SRAM, then write it to EEPROM (using energy stored in a capacitor) when power is lost, to be loaded when power returns. This seems like it would be perfect for your application.
A representative example of these parts is the 47L04.
Use a FRAM chip such as the FM24C04B. They have very high write endurance and are non-volatile.
You could also use a battery backed SRAM (NVRAM) module. For example M48Z02-150PC1
If your embedded project has NIC on it send your counter to remote computer/server. It seems 120,000 iterations in 24 hours is about one iteration in 0.72 seconds, should be OK for network traffic.
Server will always have last value of the counter stored. No counter value corruption on power loss because valid packet needs to be issued to update value on the server; however requires constant connectivity, or special time-out protocol must be designed. In addition, as a bonus, you will be able to control your device from remote if it is needed.
A) Use a 100 µF capacitor (or larger) to power up the counter during the off time. Or whatever logic that is required to hold the counter value.
B) Use magnetic-core memories, they might be a bit iffy to set up.
C) Make a motor controlled potentiometer (like a servo), at some point your counter will overflow, right? Map that to 360 degrees. Then make a feedback loop so you can set the value of the potentiometer digitally and read it digitally.
D) Send your counter value once every minute to some server, or servers, and let them remember the value for you during the off time. Then once power comes back up retrieve the counter value back.