How to interface with a large EEPROM AT24CM02

I recently need a large, durable memory, at least 4Mb (512kB). I searched and find the chip at24cm02 from microchip is 2Mb each. So I planed to load 2 of them on the i2c bus.

The at24c256(256kb) is quite popular and has a lot examples. But I learned this one has only 2bytes of address for the data, which would be insufficient for the 4Mb one.

Thus, I expect the 2Mb one has a larger address, such as 4bytes. However, the datasheet of this 2Mb chip shows that is still has 2bytes. (page 9)

The question is, how could I use up the whole 2Mb space by arduino?

Is there a better way to save so much data (without the bootloader in-chip flash trick)?

You can acces the whole pace of the memory with the arduino, but not byte by byte : these eeprom are organized in 256 bytes/pages , so the address is the pages address, and 2 bytes are suffisant (1024 pages)...
But there is a maner to access one byte in write mode (with 2 extra-adress bytes) (edited : 2 extra bits)

Thanks. PatMax. That is quite unexpected. Because microchip didn't put this limitation warraning in their datasheet.

I just checked for the 512kb version of this series. The datasheet said it still supports both byte write and page write. I wounder if one can use up the whole space or not using the byte write...

I would not be expecting microchip to provide a 'warning' at all; the addressing method is made clear in the datasheet.

The page address method, where the I2C address selects the page being used, is common in devices of this type.

The organization by pages is a little bit constraining, but we manage to deal with it. You can write byte by byte according to your needs, (within the same page, you have to manage it), and when you need to reread, you address a page and read it entirely, even to keep only the part that interests you.
(when you write 1 byte in single mode, the component rewrites the whole page, that wears it out a little faster; but there is room for improvement, you would have to write continuously (every 5 minutes) so that the wear and tear of the component would be felt within a month or 6 months...
It's a little bit constraining, but we're getting there.

I do like this: I open a 256 bytes buffer in the arduino RAM, which I load quietly as needed.
When it is full (or almost full, or when the last write in the eeprom is more than a few hours old), I write in page mode the arduino buffer to the eeprom. This way, it is not possible to tire the component by too many writes.

It is the same thing with sd card in raw mode : you acces them page by page. But there are many gigas of space, it's worth it to be a little bored !

Okay. Do I understand it correct? In the single byte write mode, one can only use up the first 512kb of this 2Mb eeprom? And in the chip, it actually writes the whole page every time anyway?

No, in single byte write, you can use the whole 2Mb eeprom, because in this mode, you must add 2 address bits to the usual 16 address-bits (to address the whole eeprom). You can write where you want. Yes, a single write byte make the entiere page to be writed (but you don't see it). If you don't write single byte too frequenly, you can make like this.

If you write sequentially (for example, for data recording), that is to say that you have a pointer that increases and scans all the pages to come back to the beginning, you can write (even frequently) byte by byte (or n bytes by n bytes) in the pages, since the number of writes is distributed on all the pages. What should be avoided is to multiply the frequent writes on the same page (well, this is theoretical, you would have to write very often on the same page for this to have an unfavourable impact on the component; in the end, I shouldn't have mentioned it).

Thanks

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.