Issue #132 [New/open] - Drivers for EEPROM chips with 16 bit addressing (24c...) available

Posted by andreas.riegg

Hi,

please find attached the necessary files to use some familiar EEPROM chips.

Such chips are a part of the new HAT standard for RPi adapter boards.

This driver is implemented inspired by the at24.c kernel driver (hence the naming). It supports all chips that use 16 bit cell addressing and ONE I2C address. Such chips are of the generic types 24c32, 24c64, 24c128, 24c256, 24c512 (as they are named within at24.c). This driver has been tested with Microchip 24LC32A (smallest one) and Microchip 24LC512 (biggest one).

This driver comes with a slightly updated Memory abstraction layer that was introduced first with issue 116 (see instructions there, these drivers have to go to a new /devices/memory folder). Old RTC drivers will still function correct. In the comment header of the __init__.py you will find the most important usage instructions.

This driver supports reading AND writing of the chips. You may also use other tools for writing (like the provided tools for HAT's) and reading will still work seamless with this driver.

Currently WebIOPi supports only the "standard" I2C channel (bus 1 since rev. 2 boards). HAT uses the fixed I2C channel 0. So currently you can't read directly the original HAT EEPROMS with this driver without (a small) modification of the I2C driver i2c.py to make it use I2C bus 0. But you can start experimenting with such EEPROM chips just connecting them to the "standard" I2C bus. And if you intent to use those chips as regular chips within your project this will be the way to connect them anyway.

I have also attached an updated version of filememory.py that is compatible with the updated Memory abstraction and an updated webiopi.js to be able to see the EEPROM chips in the device monitor.

Be patient when looking to high capacity chips with the device monitor as the display (not the actual chip reading) of a large number of memory cells (e.g. 24LC512 has 64k cells) will take some time... You can always reduce the number of used cells with the slots:xxx parameter within the config file.

manager.py and setup.py here contain only the Memory abstraction. If you want to use Memory AND Clock abstraction you can use the ones from issue 116.

Andreas

Files attached


Comment 1

Posted by andreas.riegg

Sorry, webiopi.js was the wrong version. Here is the correct one.

Files attached


Comment 3

Posted by andreas.riegg

Sorry, had wrong encoding ...

Files attached