Drivers for EEPROM, FRAM and Flash chips

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
User avatar
pythoncoder
Posts: 4173
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Drivers for EEPROM, FRAM and Flash chips

Post by pythoncoder » Wed Jan 15, 2020 7:38 am

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.
Peter Hinch

User avatar
pythoncoder
Posts: 4173
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Drivers for EEPROM, FRAM and Flash chips

Post by pythoncoder » Fri Feb 14, 2020 8:53 am

Thanks to a patch from Daniel Thompson the Flash driver now supports a wider range of NOR Flash chips.
Peter Hinch

User avatar
mcauser
Posts: 453
Joined: Mon Jun 15, 2015 8:03 am

Re: Drivers for EEPROM, FRAM and Flash chips

Post by mcauser » Mon Feb 17, 2020 6:19 am

I have a bunch of old chips to test against:

EEPROM
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
SLA24C04D 4K I2C DIP8
93C46 1K SPI DIP8

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

User avatar
pythoncoder
Posts: 4173
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Drivers for EEPROM, FRAM and Flash chips

Post by pythoncoder » Tue Feb 18, 2020 1:50 pm

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.
Peter Hinch

Post Reply