I2C EEPROM partial page write behaviour - Page 1
Forum section: electronics / projects

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 18, 2023, 10:31:58 am
content: Can anyone illuminate me with regard to the behaviour of I2C EEPROMs (e.g. 24C32) when doing page writes? Specifically, with regard to partial page writes.What I'm not clear on after having read the datasheets of EEPROMs from multiple vendors, is what happens in the following scenario:1. A write operation is initiated by sending the slave address and 16-bit ROM address to be written to,butthis address is part-way into a page.2. Multiple data bytes to be written are subsequently sent, a number equal to fill the remainder of the page.3. The EEPROM writes the page upon termination of the I2C transaction (i.e. at STOP condition).What gets written to the beginning of the page? We didn't provide any data to be written there. Is it wiped? Does it retain its previous values?Or is this one of those "just don't do that" things?

author: Dave
author_rank: Super Contributor
timestamp: August 18, 2023, 11:00:49 am
content: The data at the beginning of the page is going to be retained. You can definitely make partial page writes,just keep in mind that when you write to a page, all the memory cells of the page are going to accumulate wear cycles, regardless of whether data in them is changed or not.Edit: Crossed out the incorrect claim.

author: eneuro
author_rank: Super Contributor
timestamp: August 18, 2023, 07:49:09 pm
content: Quote from: HwAoRrDk on August 18, 2023, 10:31:58 am24C32Quote

author: Perkele
author_rank: Regular Contributor
timestamp: August 18, 2023, 08:29:46 pm
content: Isn't there also "byte" addressing mode, where the address is not defined by a page number, but by "word" address?For those EEPROMs, word size is 1 byte.The address is sent as two bytes after the I2C address.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 19, 2023, 08:54:11 am
content: Quote from: eneuro on August 18, 2023, 07:49:09 pmI was using "24C32" as shorthand for the wider contemporary range of devices, not that specific part number. You know, things like AT24C32, CAT24C32, M24C32, etc.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 19, 2023, 08:56:26 am
content: Quote from: Perkele on August 18, 2023, 08:29:46 pmYes, I know. But that's not what my question was about.

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 19, 2023, 09:05:05 am
content: Quote from: Dave on August 18, 2023, 11:00:49 amHow does that work, though? The datasheets imply that there's some kind of buffer that the received data bytes go into (with excess bytes wrapping to the beginning), then the content of the buffer is written upon end of transaction. That would mean that the buffer has to be pre-populated with the current values from the EEPROM page, surely?

author: Shonky
author_rank: Frequent Contributor
timestamp: August 19, 2023, 09:20:33 am
content: EEPROM can be written byte by byte. The pages are just to allow the host to load a bunch of bytes at once to program.It's not a page like flash where a whole page needs to be erased before writing in which case you would need to read the existing data that's not to be changed.

author: Dave
author_rank: Super Contributor
timestamp: August 19, 2023, 10:43:31 pm
content: Quote from: HwAoRrDk on August 19, 2023, 09:05:05 amDisregard the last sentence in my post - it's incorrect.Flash memory is erased page by page, whereas EEPROM can be erased byte by byte, as Shonky said.

author: eneuro
author_rank: Super Contributor
timestamp: August 20, 2023, 12:07:15 am
content: Quote from: HwAoRrDk on August 19, 2023, 08:54:11 amChoose one device (eg. 24LC65) and look into its datasheetAs simple as it is eg.: 24LC658-Byte Page, or Byte modes Available ...Voltage Operating Range: 1.8V to 6.0V ...