RobTillaart / I2C_EEPROM

Library for I2C EEPROM - 24LC512, 24LC256, 24LC64/32/16/08/04/02/01.
MIT License
91 stars 20 forks source link

DetermineSize should work for 1 byte and 2 byte addresses #17

Closed RobTillaart closed 3 years ago

RobTillaart commented 3 years ago

DetermineSize works but not for 1 and 2 bytes addresses in one go.

So the tests should be more explicit testing a given size.

RobTillaart commented 3 years ago

Cause found

Three groups of address scheme

  1. 24LC512, 24LC256, 24LC128, 24LC64, 24LC32 have a clean 2 byte addressing scheme (not tested)
  2. 24LC16, 24LC08, 24LC04 use resp. 3,2,1 bit of the device address byte as memory address
  3. 24LC02 and 24LC01 use no bit of the device address byte for memory address, but they mask 3 bits in device address as don't care. Looks like a clean 1 byte address but in fact it is not.

I2C scanner sees in group 2 and 3 eight addresses on which the EEPROM responds.

Technically the 24LC16, 24LC08, 24LC04, 24LC02 and 24LC01 use all a similar addressing scheme.

Need to think about solution..

RobTillaart commented 3 years ago

Currently implementing a new addressing scheme for all 24LCxx EEPROMS of 2K and below. Did not to break existing code so far. Testing will be finished later this week as I order some extra EEPROMS to test today.

owenduffy commented 3 years ago

Thanks Rob... Owen.

RobTillaart commented 3 years ago

@owenduffy in progress - https://github.com/RobTillaart/I2C_EEPROM/tree/develop

I have to do some tests before merging but it looks quite stable

RobTillaart commented 3 years ago

Fixed in 1.4.0 2d60816