• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Number of EEPROM erase/write cycles.

Status
Not open for further replies.

SPDCHK

Member
In all of the Microchip datasheets, Special Microcontroller Features are listed such as the typical number of erase/write cycles EEPROM data memory can handle.

What happens if this number of read/write cycles is exceeded in the lifetime of the PIC? Does the EEPROM data simply become unreliable or does it actually have a direct influence on the total operation of the PIC?

I have an application where I keep record of an electrical motors number of starts and runtime (in seconds). I store the data every single second while the motor is running.

In the case of the PIC16F88, the typical EEPROM number of cycles is 1,000,000. That gives me a total runtime of about 11.57 days (1,000,000/3600/24).

I’m quite anxious to see what’s going to happen one of these days. (Like they always ask in Brainiac, “will it float or will it sink”) :D
 

Sceadwian

Banned
It may very well work for a very long time after you think it will stop. It just becomes unreliable random bits will start reading back wrong. Why are you writing to eeprom so much, or is this just a test for the fun of it? The code/hardware can often be setup to avoid having to use eeprom so much. Even in the event of power failure a large cap a diode and a voltage sense resistor can tell your PIC when it's about to lose power and write data from RAM to eeprom.
 

3v0

Coop Build Coordinator
Forum Supporter
I would store the data to RAM up to the time the uC is powered off (looses power), then write it to EEPROM as
part of an orderly power down.

The number of EEPROM write cycles is not a fixed number. It depends on several things. Microchip has an appnote that explains it. If you provided the needed conditions you can get many more cycles then the stated limit.

3v0
 

SPDCHK

Member
Even in the event of power failure a large cap a diode and a voltage sense resistor can tell your PIC when it's about to lose power and write data from RAM to eeprom.
Okay :rolleyes:. I never thought of doing that. Storing the data is mainly for my own interest. I did not know that there was a limit to the number of EERPOM read/write cycles when I started the coding.

I must admit, I’m one of those people who uses the “Find” function of adobe reader on the PDF datasheets to only search for what I need. I don’t read the whole document :eek:

Unfortunately the PCB for the circuit is built already, so implementing the power fail trigger will have to be done on my next project. I will scale down on the number of times storing the data. Once a minute should be fine for my needs.
 

Sceadwian

Banned
Yes, my suggestion of the diode cap and sense resistor will even protect the memory during sudden power outages, if the cap is large enough to power the PIC long enough to write the eeprom. But you have the diode drop to deal with.
 

Sceadwian

Banned
Oh SPDCHK you're missing so much! You should take the time to read through the entire PDF of the main chips you use at least once, you'll learn all sorts of good stuff.
 

Papabravo

Well-Known Member
...
I must admit, I’m one of those people who uses the “Find” function of adobe reader on the PDF datasheets to only search for what I need. I don’t read the whole document :eek:
...
I sure am glad I didn't hire you to build something for me only to find out on the tail end of the project that you took the scattershot approach to reading the datasheet. That is a truly stunning admission -- and I'm well...stunned -- deer in the headlights, knock me over with a feather. I hope for your sake and sanity on future projects that you consider an alternate approach. Trust me on this you will reap enormous dividends from a minor change.
 

SPDCHK

Member
Guess I painted myself in a corner here hey?

I do this only as a hobby, and don't really have that much time to spend on it. For example, this project that I'm referring to, took me over a year to finish. Working away from home commissioning C&I control systems is taking it's toll on me :(
 

Sceadwian

Banned
Yep, pretty much. That's a bad lesson to learn though. RTFM is one of my favorite acronyms. "Read the F'ing manual" for those that don't know. If you can't make time to read and learn you WILL find time to suffer and sulk.
 

blueroomelectronics

Well-Known Member
I'm constantly referring to the datasheet when designing. I'm considering one of those Sony ebook readers PRS-505 so I can have them on the go (with my magazines too of course)
 

Sceadwian

Banned
I've thought of those too, but considering the cost, carrying a netbook type machine around with you is almost more practical, and a LOT more useful. I would definitely say you should go to a store that has a demonstration model with a few PDF's you reference frequently and have them pop them up for you so you can determine how useful it'd actually be. The only advantage of an e-book reader like that is that it's battery life is measured in 'page turns' rather than hours running. Consider how far away from an electrical outlet you are when you're using something like that and the cost/benefit of a netbook should start to take over. If you REALLY need portable and long run times a netbook with a home built extended battery becomes possible as well.
 
Last edited:

blueroomelectronics

Well-Known Member
It's the form factor. It's tiny and you apparently can put the days newspaper on it with rss feeds. It's 8mm thin and the screen is easy on the eyes.

I've not bought it yet but it's tempting.
 

Sceadwian

Banned
The Sony one is very tempting, I've been drooling at it since the first version of it came out. If they can just up the resolution on the things a bit I'll be happier though, then again I've never actually test drove one before so I'm not sure how really usable they are. Like I said, pop a PDF on a memory stick and bring it to a retailer, I'd be curious to hear your thoughts on them.
 

Sceadwian

Banned
By the way SPDCHK, sorry for hijacking your thread =\
 

Diver300

Well-Known Member
Most Helpful Member
Back to the eeprom problem, the way that I approached the problem was to only store the run time every minute.

There is also a microchip application note about spreading out the wear on an eeprom. With a suitable algorithm, I write to the each location in half of the eeprom in turn. That way, each location in eeprom is only written every 128 minutes. That gives a life of 1,000,000 * 128 / 60 / 24 / 365 = 243 years
 

Sceadwian

Banned
Diver, if you place a diode (Schottky) in line with a large capacitor to buffer the IC's main power and use a feed back line from the system VCC you can tell when the power fails and act before the cap drains. No need to use a set period of time, just make sure the cap is large enough to buffer the chips power long enough to write eeprom once it detects the power failure. This does have the effect of introducing a diode drop into the VCC line though.
 
Last edited:

SPDCHK

Member
Back to the eeprom problem, the way that I approached the problem was to only store the run time every minute.

There is also a microchip application note about spreading out the wear on an eeprom. With a suitable algorithm, I write to the each location in half of the eeprom in turn. That way, each location in eeprom is only written every 128 minutes. That gives a life of 1,000,000 * 128 / 60 / 24 / 365 = 243 years
Diver, are you referring to AN537?
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top