Go Down

Topic: How to read 24Cxx I2C Eprom bigger than 2Kb (ie 4kb) (Read 5 times) previous topic - next topic

hansibull

you can use the EEPROM24 library.
I've used it a lot and it's easy to interface with, and doesn't take a lot of space either.
you can download it here: http://rweather.github.io/arduinolibs/classEEPROM24.html

hary

What makes me mistaken is that I've been using 24c02 and 24C04 that are addressed on only 1byte.

You'll say, the 24C04 can't be addressed on only 1 byte. But it is ! Well not really.

In fact, the address block is on 1byte, the 24C04 is seen as 2 devices (1 on 0x50 and 1 on 0x51), the A0 pin has no function (no connect) and there is a 9th bit somewhere that I can't yet understand how it works and where it is.
This means that a 24C04 is using 2 devices addresses !

Bigger I2C Eeprom have their block address coded on 2 bytes, that mean up to 64kB on the same device I think (24C512)

The link you gave previously talks about a 24LC1025 24LC1026 of 128kB !
Twice more addresses than 2^16 (2 bytes addresses possibilities).

Is it using the same trick as for the 24C04 ?

This is quite confusing to me indeed !

Erdin

It is confused. You have to check for every EEPROM how to interface it.

Those 24LC1025 use the same trick. They have two bytes for the address and the missing 2 address bits are in the I2C address. So it should be on the I2C bus as being four devices.

hary

Would you excuse me for insisting so much, but the 24LC1025 shouldn't it be seen only as 2 devices ?

The 24LC512 is seen as 1 device. Right ?
2 bytes is 16 bits that gives 65536 possibilities for block's address.
and the 24LC512 has 512*1024/8 = 65536 block addresses. right ?

So the 24LC1025 should be seen only as 2 devices. (2 x 24LC512)

Or am I wrong.

Erdin

You are right.
Sorry for the confusing.
According to the datasheet, an address bit "B0" in the I2C address selects which 'half' of the memory is selected. So that is one extra address bit.

Go Up