Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Clearing EEPROM at once.

Status
Not open for further replies.

Raady Here

Full Member level 5
Joined
Jun 8, 2013
Messages
242
Helped
26
Reputation
52
Reaction score
26
Trophy points
28
Location
India
Activity points
1,571
HI

24LC256 Serial EEPROM,

I am using EEPROM with I2C , and I use a lot of commands to make all addresses to zero state. Is there any method , so that I can completely erase all data in my EEPROM at once ?


Regards,
Raady.
 

I have no problem in writing or reading Serial EEPROM !
In my EEPROM I am using addresses from 0x0000 to 0x1A20(available 0x0000 to 0x7FFF). For this I use multiple times, writing 0 to EEPROM. Instead of using the write multiple times, is there any possibility to reset every thing to zero at once so that it will be as the new one.

Memory present in Microcontroller is flash memory and erasing the complete flash at once is possible from MPLAB, similarly is that possible to do in Serial EEPROMs also ?
 

I don't see a bulk-erase command in the datasheet
Some serial flash devices have bulk-erase, but it is slow
I'll bet MPLAB does just as you do to erase the device, just without bothering you about details.
 

hello,

maybe you can erase page per page of 64bytes.. instead of byte per byte..
 

There are no erase opeation if we are speaking about eeprom. You can write 0xFF using page write command to perform fast erase. But page erase functions available only in NAND flash.
 

I dont think is it possible to do bulk erase in serial flash as in EEPROM. I hope you will not be writing the datas in all locations because may be you are just using it for storing some calibration factors. So try only accessing that location that may reduce your timing.
 
  • Like
Reactions: Dont

    Dont

    Points: 2
    Helpful Answer Positive Rating
The c code for erasing all EEPROM pages doesn't need more lines than the text Raady Here has written in this thread, including the acknowledge polling required for effective fast execution.
 

The c code for erasing all EEPROM pages doesn't need more lines than the text Raady Here has written in this thread, including the acknowledge polling required for effective fast execution.
Nice and thanks FvM
I am not much worried about the time taken. I am using in an user interface application, where user have an option to erase all previous stored data. Though user does this rarely, I am concerned about the number of write cycles I am using for it, to make all the addresses to zero. All though EEPROM that I am using has 100000 write cycles, I though if there would be any better way.
 

I dont think is it possible to do bulk erase in serial flash as in EEPROM. I hope you will not be writing the datas in all locations because may be you are just using it for storing some calibration factors. So try only accessing that location that may reduce your timing.

It is possible, and it is slow

SFLASH.png
 
  • Like
Reactions: Dont

    Dont

    Points: 2
    Helpful Answer Positive Rating
Try like this


Code C - [expand]
1
2
3
4
for(i = 0; i < eepromSize; i++) {
       EEPROM_Write(i, 0);
       Delay_ms(20);
}

 

Fast 24C256 erase using page write and acknowledge polling

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
for (page=0; page < 512; page++)
{
   do
      i2c_start();
   while (!i2c_write(0xa0)); // repeat if no ACK
   i2c_write(page >> 2);
   i2c_write(page << 6);
   for (i=0; i < 64; i++)
      _i2c_write(0xff);
   i2c_stop();
}

 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top