5 years, 6 months ago.

Problems with EEPROM "Page Write" (24LXxx Serial EEPROM)


I use this library (24LCxx_I2C) for a EEPROM (Renesas R1EX24512ASAS0A - which is compatible to 24LC512).

The problm is, that this library doesn't take care of page boundaries when writing to EEPROM!

As the manual for the 24LC256 says:

"Note: Page write operations are limited to writing bytes within a single physical page, regardless of the number of bytes actually being written. Physical page boundaries start at addresses that are integer multiples of the page buffer size (or ‘page size’) and end at addresses that are integer multiples of [page size – 1]. If a Page Write command attempts to write across a physical page boundary, the result is that the data wraps around to the beginning of the current page (overwriting data previously stored there), instead of being written to the next page, as might be expected. It is, therefore, necessary for the application software to prevent page write operations that would attempt to cross a page boundary."

Here http://www.hobbytronics.co.uk/eeprom-page-write is a good explanation for the problem and a code-fragment for a solution.

Also it doesn't prevent writing larger amount of data as one page!

Are there mbed-libraries which work correct for page write?

PS: My 512k-EEPROM has 128-byte page size - page size depends on the EEPROM-Size.

Question relating to:

Be the first to answer this question.