24LC512 I2C memory

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

Re: 24LC512 I2C memory

Post by pythoncoder » Tue Dec 17, 2019 7:21 am

The FM24CL16-G 2KiB chip is not the one on the Adafruit board. That uses the Fujistu MB85RC256V 32KiB device so you would need to modify my driver to suit: the driver makes an explicit check on the chip type.

I can't support every chip, and yours has a tiny capacity - too small for filesystem use.
Peter Hinch

mikruth
Posts: 19
Joined: Wed Jan 11, 2017 6:00 pm

Re: 24LC512 I2C memory

Post by mikruth » Mon Jan 20, 2020 10:24 am

This works for me.

from machine import I2C, Pin
i2c = I2C(scl=Pin(22), sda=Pin(21), freq=400000)
i2c.writeto_mem(80, 0, 'test', addrsize=16)
data = i2c.readfrom_mem(80, 0, 4, addrsize=16)

Post Reply