24LC256 eeprom

marky26uk

New Member
Hi all, to erase my eeprom i write 0's from 0 - 32767 like this:-

for w0=0 to 32767:writei2c w0,0:pause 10:next w0

Is there a different quicker way of doing this ?

Cheers,
Mark
 

marky26uk

New Member
eeprom

The sticky out tongue face should be a p, which it is but it seems to be putting a face instead lol

Mark
 

hippy

Ex-Staff (retired)
It's the :P which pulled up the sticky tongue.

You can reduce the time by writing blocks at a time ...
Code:
For w0 = $0000 to $7FFF Step 16
  WriteI2c w0,( 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 )
  Pause 10
Next
The ideal number of zeroes would match the Eeprom page size and should normally be a power of two ( 2, 4, 8, 16, 32, 64, 128 etc ). Don't attempt to write more than the Eeprom page size or it will not work. The downside is that the more you zero in one command the larger the program size.

It's also worth looking at your overall program design to see if you can get away with not having to zero the Eeprom at all, keeping a pointer to last used location and so on.
 

Matt_C

Member
Don't know how often you will erase the EEPROM but they do have a life. I think it's around a million write+erase.
 

sghioto

Senior Member
I'm confused on this write/erase cycle. When the specs say one million erase/write cycles does this mean each byte can be written to a million times or the total number of bytes written to safely is one million? If I only use 1 byte to store my info then I can rewrite this byte a million times. Is this correct? But if I write to 10,000 bytes I can only rewrite these 10,000 bytes 100 times?

Steve G
 

ylp88

Senior Member
I'm confused on this write/erase cycle. When the specs say one million erase/write cycles does this mean each byte can be written to a million times or the total number of bytes written to safely is one million? If I only use 1 byte to store my info then I can rewrite this byte a million times. Is this correct? But if I write to 10,000 bytes I can only rewrite these 10,000 bytes 100 times?
I seem to recall that Microchip defines endurance as the number of erase/write cycles you perform on the chip, regardless of its address, before it fails. However more important with regard to EEPROM life are other factors - luck for example! Some EEPROMs just "wear out" very fast. This is made especially true by the fact that I think that most of the EEPROM/Flash memories that we use do not have wear-leveling systems, unlike most consumer Flash products such as Flash cards and drives.

Other things such as operating voltage and temperature (especially the former) have been shown to have significant effects on EEPROM endurance as well; you can find more information regarding the effects of voltage of endurance in a Microchip applications note, although I don't have a reference number handy but a site search might turn up something. http://ww1.microchip.com/downloads/en/AppNotes/01019A.pdf

In this AN, it lists the following desirable characteristics of EEPROM operation:
• Keep the application temperature as low as possible.
• Keep the application voltage (or the VCC voltage on the EEPROM) as low as possible.
• Write as few bytes as possible.
• Use page write feature whenever possible
• Write data as infrequently as possible.

ylp88
 
Last edited:

marky26uk

New Member
24lc256

Hi all, i tried the method Hippy suggested, i was amazed at the speed increase atleast quadrupled the speed of erasing the chip now, thanks Hippy.

Yours,
Mark
 
Top