I have a quick question about supported i2c eeprom types.
From the user side is there a way to query/list supported types (ie.
24c256)?
The 24C256 is 32K * 8, and as such, needs a 16 bit address. This
particular chip ignores the most significant bit of the address. With
this same addressing model, the maximum capacity would be 64K, which
would use all 16 bits, and would be a 24C512.
The 24C1024 will need 3 address bytes, not two, and unless the driver
knows to put in that third address byte, the maximum addressable range
is 64K.
Further, there are several ways of writing data, either page mode or
byte mode. Byte mode needs an address for each byte. Page mode must
be written so that the data does NOT cross an absolute page boundary,
otherwise it wraps without an error and you get bad data written. Page
size does vary amongst the various chips in the family. You write a
page (or part of a page) without wrapping, and then the chip refreshes
and writes the new page.
Reading must be done by starting a write (chip address and 16 address
bits), a repeated start, and then the chip address as read. Data can
be read as long as the read sequence is active, page boundaries are
not significant here. If no address is provided, the previous address
is used as a start and automatically incremented each byte read.
So basically, 24C01, 24C02, 24C04, 24C08, 24C16, 24C32, 24C64, 24C128,
24C256 and 24C512 can all be handled with 16 bit addresses. The
24C1024 and above need the 24 bit address driver. If the driver knows
the page size, then all of these chips can be written by the same
driver. Reading can handle any of these chips.
Had to write a driver for these chips a few weeks back.
Pretty much anything in the 24C series below a 24C1024 can be read and
written by the same driver if you know the parameters. 1024 and above
can be handled if the driver is smart enough.
No idea how the existing driver is written, but this is what's
involved.
Harvey