0
\$\begingroup\$

I have learned about page write operations from App notes and data sheets of EEPROM chips.But i want to clear certain doubts. I have an EEPROM chip which got 32KB and 64B Page Size.

1.Can i Write less than 64 Bytes? Say n Bytes

If yes then What happens to the remaining locations(64-n) in case of Page write?(Will it Stay OxFF or turns 0).

This is the EEPROM chip 24LC256.

\$\endgroup\$
  • \$\begingroup\$ There is a possibly helpful answer here: electronics.stackexchange.com/questions/86019/… \$\endgroup\$ – David Jan 10 '14 at 7:25
  • 4
    \$\begingroup\$ I have lost track of the number of comments I have left asking for clarification on your questions. What EEPROM do you have? Where are the datasheets and appnotes? \$\endgroup\$ – David Jan 10 '14 at 7:29
  • \$\begingroup\$ The 24LC256 is 256KB, but you mention a 32KB device. Which is correct? \$\endgroup\$ – David Jan 10 '14 at 13:20
  • 1
    \$\begingroup\$ The 24LC256 is not 256KB, it is 256Kb. \$\endgroup\$ – Brian Drummond Jan 10 '14 at 13:56
  • \$\begingroup\$ Thanks @BrianDrummond, sloppy on my part. I can't edit it now so have upvoted your correction. \$\endgroup\$ – David Jan 10 '14 at 14:09
2
\$\begingroup\$

I'm not sure you realize what are the implications of an eeprom page. Here is the 24LC256 datasheet

One option to fill it is to write individual bytes. Using that mode you send the eeprom byte address for each byte you want to write so the page location poses no limit.

An alternative option is to write a block. The size of the block for the particular device is 64 bytes so the pages boundaries are

0-63
64-127
128-191
....

When you write a block you only send the memory address once and then send the bytes to be stored. The address increments internally for each new byte.
The page writes can only be used inside the boundaries of a page, what you reach the page boundaries you have to stop and start a new write sending the address again.

If you start a block write from an address that is near the end of the block then you can only write a few bytes until the end of the page rather than 64 bytes. For example If you start a block write from eeprom address 126 then you can only write two bytes, in locations 126 and 127. If you keep writing bytes then the address rolls over and overwrites the start of the block (in this case 64, 65..)

In any case values of any eeprom location where a write or erase action hasn't been performed maintain the existing value.

So for your question

Can I Write less than 64 Bytes?

Sure you can either with individual byte writes or with page write but withing the page boundaries which will be (0-63, 64-127...)

If yes then What happens to that locations?(Will it Stay OxFF or turns 0).

Is I explained earlier values in location where a write or erase cycle hasn't been performs maintain their existing value. Usually unwritten eeprom have 0xff written to all byte locations so this will be maintained.

\$\endgroup\$
2
\$\begingroup\$

Typically an EEPROM erases to 1 bits and you can change any 1 to a 0 but you must erase again to go back to 1. You may need to write the whole page (depending on your interface) but if you write all 0xff you can almost certainly go back and write other values later. If you write all 0x00 you will have to erase to change the data. You can overwrite the beginning with its existing data if you have to write in blocks.

\$\endgroup\$
1
\$\begingroup\$

1) Yes you can write less than 64 bytes. You can read/write EEPROM on a byte-per-byte basis if you wish. This can be slower for large data operations though.

2) Once you erase a page (turn all to 0xFF), if you then write to only some byte locations, the rest will stay at 0xFF until you do something to them.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.