0
\$\begingroup\$

I'm facing a strange issue. Whenever I write to my EEPROM (24LC04B), it gets written to every other page as well and I can't understand why.

i2cdetect -y 1 returns 8 pages:

 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
 00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 50: 50 51 52 53 54 55 56 57 -- -- -- -- -- -- -- -- 
 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
 70: -- -- -- -- -- -- -- --  

first line of the first address: i2cdump -y 1 0x50:

15 15 20 10 10 00 00 00 00 18 18 18 18 18 18 00    ?? ??....??????.

first line of the third address (same data): i2cdump -y 1 0x52:

15 15 20 10 10 00 00 00 00 18 18 18 18 18 18 00    ?? ??....??????.

I update the 0x52 first block to 0x03: i2cset -y 1 0x52 0x00 0x03, the output of i2cdump -y 1 0x52 is as expected and first block got updated to 0x03:

03 15 20 10 10 00 00 00 00 18 18 18 18 18 18 00    ?? ??....??????.

BUT the first block of 0x50 address got updated as well: i2cdump -y 1 0x50:

03 15 20 10 10 00 00 00 00 18 18 18 18 18 18 00    ?? ??....??????.

I can't understand why. It seems like every other address is a clone of each other:

0x50 = 0x52 = 0x54 = 0x56 (same data, if one gets updated, all get) 
0x51 = 0x53 = 0x55 = 0x57 (same data, if one gets updated, all get)

Any hints please? Thanks!

\$\endgroup\$
3
\$\begingroup\$

I think you misunderstood the 24LC04 is a 4096 BIT EEPROM, not 4096 byte. So you only have two pages of 256 byte.

If you read section 3.6 of the Datasheet, you see it doesn't care about bit 1 and bit 2 of the I²C device address either. The A0, A1, A2 inputs are not used at all in this chip.

So, that's why your chip is "mirrored" to 0x52, 0x54 and 0x56. And of course, the second page to 0x53, 0x55 and 0x57.

\$\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.