CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

How many times can 16F877A EEPROM be written

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
zilot



Joined: 21 Nov 2006
Posts: 16

View user's profile Send private message

How many times can 16F877A EEPROM be written
PostPosted: Sat Dec 09, 2006 4:01 am     Reply with quote

In data sheet stands for EEPROM

Endurance 100K at 25C and 5V. Units are E/W (suppose erase, write), does it mean that in program that chip executes in its life you can call 100 000 times instruction for writing same EEPROM location, or you can access whole EEPROM in that number of times (doesn't matter which location you use for writing). So if one want to elongate time of storing single variable in EEPROM he must change its location after 100K times, true or not?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Dec 09, 2006 1:18 pm     Reply with quote

Quote:

Does it mean that in program that chip executes in its life you can
call 100 000 times instruction for writing same EEPROM location, or
you can access whole EEPROM in that number of times

Download AN537 from Microchip, on Serial EEPROM Endurance:
http://ww1.microchip.com/downloads/en/AppNotes/00537.pdf
Read the 3rd paragraph on the left side of page 4:
Quote:

For example, if a part is rated to 100K E/W cycles,
then each individual byte can be erased and written
100K times. The part is NOT limited to only a total
of 100K E/W opcodes or control bytes.


Also read AN1010, EEPROM Endurance Tutorial:
http://ww1.microchip.com/downloads/en/AppNotes/01019A.pdf
Ttelmah
Guest







PostPosted: Sat Dec 09, 2006 3:56 pm     Reply with quote

There are a couple of extra 'caveats', which may be worth considering if looking for high reliability. It might be worth avoiding the first, and the last EEPROM cell. In the past on a couple of other processors, warnings have existed, that in the event of certain 'brownout' events, the registers holding the address, can get reset, while the write still continues. Depending on whether they reset to '1', or '0', this can potentially overwrite these end cells.
Seperately, it is well worth using a read, to verify what the cell contents 'are', before writing. Writing the same data, uses a 'life', and avoiding this takes very little time indeed.
It is also worth considering whether you really have to write at all. I have a number of systems, some of which have been running continuously now for years, using the older EEPROM variants, with shorter lives. On these, data is updating at short intervals, yet the write life has not yet even been approached on any of the systems. The reason is that they don't write the data to EEPROM, till the main unregulated incoming supply rails drops below a critical voltage. On most of these systems, half a dozen writes a year, would be quite typical. It is relatively easy to calculate how long a capacitor will maintain sufficient voltage for the regulated rail to be maintained. One system for example, is a sheet counter, on the paper rolls used to feed printing presses in newspaper systems. The count rate, can be thousands a minute, and the system must maintain count, so long as power is available, and carry on when power is restored.

Best Wishes
zilot



Joined: 21 Nov 2006
Posts: 16

View user's profile Send private message

PostPosted: Sun Dec 10, 2006 6:30 am     Reply with quote

Thank you both

Quote:
It is also worth considering whether you really have to write at all. I have a number of systems, some of which have been running continuously now for years, using the older EEPROM variants, with shorter lives. On these, data is updating at short intervals, yet the write life has not yet even been approached on any of the systems. The reason is that they don't write the data to EEPROM, till the main unregulated incoming supply rails drops below a critical voltage. On most of these systems, half a dozen writes a year, would be quite typical. It is relatively easy to calculate how long a capacitor will maintain sufficient voltage for the regulated rail to be maintained


Thats is exactly that what I was considering. To put huge capacitor to hold voltage long enough to write last given control value in EEPROM. But as PCM programmer says 100k times per each memory location will give about 27 years for only one location (if one loaction is written not more than 10 times per day), so I think there is no need to complicate whole stuff with voltage monitoring.

BTW when you mentioned that, how do you do that. Use AD converter and then generate interrupt for some voltage below you specify, or there is some circuit specialy made for supply voltage monitoring?Maybe use analog comparator wih given Vref (zener for example) somewhat lower than supply voltage and when supply drop comparator generate signal to triger for examle B pin and generate interrupt.
Ttelmah
Guest







PostPosted: Sun Dec 10, 2006 9:48 am     Reply with quote

It depends on your supply. These systems, have an unregulated 24v supply (part of an industrial system), which is regulated to feed the PIC. The supply is fed in via a low voltage drop diode, so that when the 24v 'falls', other equipment on the bus does not start loading the capacitor on the PIC supply. Then there is the capacitor, and a LDO regulator. The regulator can maintain 5v, down to 5.6v in. The original systems had a power supply supervisory IC, which gave a switched output when the capacitor voltage fell below 18v. On other similar systems, I have used things as simple as a TL431, to monitor the supply. The capacitor can be suprisingly small in fact. Writes take typically 4mSec each, and if you have 10 bytes to write, this only requires supply maintenance for 40msec after detection. If the PIC turns off it's peripherals straight away, the current is normally only a few mA (depends on clock rate). for 20mA (say - remember to include the consumption of the regulator), with detection 3v above the drop out voltage, you only need:

(0.02*0.04)/3 Farads

This works out as just under 270uF. I used 470uF (you must remember that most electrolytics have something like a 20% tolerance...).
The write, after completion, sits and waits for a while, and then if the supply goes back above the threshold, restarts the code cleanly.
For something as infrequent as a few times a day, there is no point. The counts on these were updating hundreds or thousands of times a minute...

Best Wishes
zilot



Joined: 21 Nov 2006
Posts: 16

View user's profile Send private message

PostPosted: Mon Dec 11, 2006 9:01 am     Reply with quote

Thank you Ttelmah for useful hints. I understood eveything, will bear in mind for future projects.

regards
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group