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.
User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Drivers for new Adafruit FRAM boards

Post by pythoncoder » Sat Sep 05, 2020 5:46 am

There is no limit in the code. The practical limit is the fact that each chip requires a separate CS line. I guess with very large numbers capacitance on the SPI bus might slow things down.

I'm deeply impressed by those FRAM boards which now have capacity to rival EEPROM with effectively zero wearout and 200 year data retention. They are fast, too.
Peter Hinch
Index to my micropython libraries.

sheltyle
Posts: 1
Joined: Sun Jul 26, 2020 2:25 am

Re: Drivers for EEPROM, FRAM and Flash chips

Post by sheltyle » Sun Feb 28, 2021 6:21 pm

I am trying to use this library in a project using pycom boards. Line 71 of 'fram_i2c.py' uses the I2C fucntion 'writevto', which is unavailable for use with the pycom version of micropython:

Code: Select all

self._i2c.writevto(self._i2c_addr, (self._addrbuf, buf[start: start + npage]))
Does anyone know a workaround for this using 'writeto'?

Thanks

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

Re: Drivers for EEPROM, FRAM and Flash chips

Post by mcauser » Sun Feb 28, 2021 11:10 pm

writevto() was recently added for writing a tuple/list of buffers.
Same can be achieved by combining the bufs and calling write() once, or calling write() multiple times within a start() - stop().

Code: Select all

# new way
self._i2c.writevto(self._i2c_addr, (self._addrbuf, buf[start: start + npage]))

# old way, combining bufs, not the most efficient
self._i2c.writeto(self._i2c_addr, self._addrbuf + buf[start: start + npage])

# old manual way, multiple writes
self._i2c.start()
self._i2c.write(bytearray([self._i2c_addr << 1]))  # note: writeto() does this internally for you
self._i2c.write(self._addrbuf)
self._i2c.write(buf[start: start + npage]))
self._i2c.stop()

User avatar
Meekdai
Posts: 45
Joined: Mon Jan 29, 2018 12:45 pm

Re: Drivers for EEPROM, FRAM and Flash chips

Post by Meekdai » Thu Dec 09, 2021 1:29 am

Hi everyone,
I have a project that needs to record the number of motor rotations every 1 second to prevent data loss caused by power down. I want to use FRAM to save my motor rotations data. But M85RS2MT or M85RS4MT is too expensive. For me MB85RC16 (16 K (2 K × 8) Bit I2C) or MB85RS64A (64 K (8 K × 8) Bit SPI) is enough.

The drivers https://github.com/peterhinch/micropython_eeprom only support FRAM (M85RS2MT and M85RS4MT). Is it possible to let it support small-capacity FRAM for data reading and writing?

Thanks.

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

Re: Drivers for EEPROM, FRAM and Flash chips

Post by pythoncoder » Thu Dec 09, 2021 9:42 am

FRAMs are very simple devices to drive. Unfortunately I can't develop a driver for hardware I don't possess so I'm afraid you'll have to adapt the driver yourself. If you do this and have success by all means issue a PR.
Peter Hinch
Index to my micropython libraries.

JeffT
Posts: 2
Joined: Mon Jul 11, 2022 1:58 am

Re: Drivers for EEPROM, FRAM and Flash chips

Post by JeffT » Sun Dec 04, 2022 4:14 pm

This is really neat, I just got to playing with the 2 Mbit Adafruit spi fram breakout and an ESP32 dev kit and had a FRAM file system in no time, ty for posting

Post Reply