EEprom writing

Apr 07, 2005 11 Replies

Define a long time.

If you do a simple write, then the Microchip version has a 1msec write for a byte/page mode cycle. But if you are doing an erase first, it'll take longer. Of course, if you are writing a number of bytes (rather than pages) it'll take quite a while.

A lot depends on the particular device, of course.

Cheers

PeteS

It's the nature of the beast. If you can't stand the delay (perhaps because you have other devices on the shared I2C bus(, either implement a second I2C bus (or other dedicated bus such as SPI or Microwire for the EEPROM) or use a nonvolatile technology with less inherent write time, such as ferroelectric RAM or battery-backed SRAM.

Best regards, Spehro Pefhany

"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com

I use the I2C bus for writing/reding eeprom 24Cxx, with 8051 Micro family.



When i write to it, i have to wait a lot of time, otherwise nothing is written.



It seems i follow the correct signals sequence, but i cannot get out of this delay.



Is there someone that has experience ?



Enzo


Well, writing an EEPROM takes a few ms per adress. You could do something else in the remaining time. Do you poll for a flag or is there an interrupt ?

Rene

Ing.Buero R.Tschaggelar - http://www.ibrtses.com & commercial newsgroups - http://www.talkto.net

Also, the delay is the same to write one byte, as to write a 'block'. Most of the chips support 16 byte or more 'block write' mode, so you can save a lot of time if moving big amounts of data, by using the block write feature. You can also verify whether the write has finished by doing a 'start', sending a command, and checking for ack. This allows the delay to reduce in some cirumstances (the write time changes with temperature, voltage etc.). The FRAMs are great though. I have used these for a couple of years on various projects, and they are a godsend where you don't want the delays.

Best Wishes

Ramtron has FRAM which has "no delay writes" (actuall 72nS I think).

The have are mostly drop in I2c compatable with 24cxx eerpoms... part no FM24Cxx.

formatting link

this

So do I. :-)

Please define 'a lot of time'.

Did you code your own routine to handle the I2C bus or use a library routine such as supplied with a compiler ? Are you using an 8051 derivative with a dedicated I2C controller or simply using general port pins ?

Are you using a high level alnguage - if so - which one ? Do your Eeprom writes and reads work OK ?

Well, Eeproms aren't hugely fast ! Maybe you're expecting too much ?

How many bytes of data are you typically writing at a time ?

Graham

What's the data rate on the serial data line to achieve that ? ;-)

That's the blink of an eye to an 8051.

Graham

That's a crazy length of time. Sounds more like a WDT timeout while waiting for a ACK that never comes. Don't quote me on this, but IIRC, you have to poll the device to get it to ACK after a write.

Yes. I've seen enough errors in this kind of routine, even from manufacturers, that I carefully analyze it before using it. Saves a lot of time and understanding the code is never a bad thing.

Best regards, Spehro Pefhany

"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com

I'm using general purpose pins of 8051, for SDA and SCL signals. The problem comes from the ACK from the eeprom, that sometimes takes a lot of time to arrive. The SDA pin gooes low after a lot of time (0.5 sec !!!).

The software is in c (IIAR compiler)

I'm doing something wrong.

Enzo

Bingo! I think you start to do another write and see if you get ACK - this means its done with the last one. If not, then do another...

Luhan Monat (luhanis 'at' yahoo 'dot' com) "The future is not what it used to be..." http://members.cox.net/berniekm

Thanks for mentioning! I was looking for serial SPI compatible RAM for some time.

Reply to nico@nctdevpuntnl (punt=.) Bedrijven en winkels vindt U op www.adresboekje.nl

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required