Page 1 of 1

Drivers for EEPROM, FRAM and Flash chips

Posted: Wed Jan 15, 2020 7:38 am
by pythoncoder
I have written this set of drivers for various chips which use I2C or SPI interfaces. The drivers use common base classes to provide the following features:
  • Support for single or multiple chips on the same bus. Multiple chips are automatically configured as a single array.
  • This can be accessed as an array of bytes, using Python slice syntax or via a readwrite method.
  • Alternatively the array can be formatted and mounted as a filesystem using methods in the uos module. Any filesystem supported by the MicroPython build may be employed: FAT and littlefs have been tested. The latter is recommended.
  • Drivers are portable: buses and pins should be instantiated using the machine module.
  • Buses may be shared with other hardware.

Re: Drivers for EEPROM, FRAM and Flash chips

Posted: Fri Feb 14, 2020 8:53 am
by pythoncoder
Thanks to a patch from Daniel Thompson the Flash driver now supports a wider range of NOR Flash chips.

Re: Drivers for EEPROM, FRAM and Flash chips

Posted: Mon Feb 17, 2020 6:19 am
by mcauser
I have a bunch of old chips to test against:

AT24C01A 1K I2C DIP8
AT24C02N 2K I2C DIP8
AT24C04A 4K I2C DIP8
AT24C08 8K I2C DIP8
AT24C16 16K I2C DIP8
AT24C32A 32K I2C DIP8
AT24C64N 64K I2C DIP8
AT24C128 128K I2C DIP8
AT24C256 256K I2C DIP8
ST24C16CB1 16K I2C DIP8
24LC512 512K I2C DIP8
P24C256 256K I2C DIP8
93C46 1K SPI DIP8

W25Q32 32M SPI module
W25Q64 64M SPI module
W25Q128 128M SPI module

Re: Drivers for EEPROM, FRAM and Flash chips

Posted: Tue Feb 18, 2020 1:50 pm
by pythoncoder
Re EEPROMs I don't know how much interface commonality exists between the chips on your list and those I tested. The EEPROM driver currently assumes a block size of 128 bytes which would rule out some, although I could make block size configurable. Assessing compatibility would need a trawl through datasheets.

Flash chips are a different matter.

Evidently many devices have a high degree of standardisation so it would be interesting to try the flash chips. The W25Q32 has already been tested, but the other two have not. If you fancy giving them a try I'll put the results into the docs. On the face of it there's a good chance they will be compatible; the equivalent sized Cypress chips are fine.