Using I2C memory chip 24LC256

Does the MB85RC library work with the 24LC256 chip? I need to remember a few variables without power or wifi and the 24xxnn were recommended. The data sheets are similar but I’m not getting the results I expect. The only chip the local store sells is the 24LC256 so I’m trying it, verses driving or waiting.

Using the library, I’m not getting errors, just no results. Reading the chip, the bytes I looked at are all null. Using the clear(0), the first 24 bytes were changed from 0xFF to null. Writing returns a ‘0’ but reading the byte, it is still null.

I have tried a few non-library writes & reads without success as well. The data sheets for the 24XX256 mention stop & start bits - and the Arduino examples are more confusing than helpful. The Digole display on the i2c bus is working well using 2K pull-ups at 50K, lower resistance or higher speeds don’t work.

To be honest, the MB85RC library probably won’t work with the Microchip 24LC256 - it’s for a completely different part. Your best bet is to take a look at the library’s source code and the 24LC256 datasheet and try and see where the former needs modifying to support the latter. You can just drop the modified class into your own code; it doesn’t need to be used as a library, though if you get it working, we’d certainly consider adding your class to our FRAM libraries.

Thanks for the fast answer and suggestions. Looking over the datasheets, i really couldn’t see a difference, from the pin-outs to the ‘1 0 1 0 A2 A1 A0 N’ but i did find my error in its use!

As far as I can tell, the MB85RC library works with the 24XX256 EEPROM. Picking an address of 0x00A0, i write 68. When I read the location back, server.log() prints a D.

Which is correct. Is there a method() to turn it back to 68?

If the library’s read() method returns a 1-byte blob, b, try b[0]

Thanks philmy, it works perfectly.

return( resultlow[0] + 256 * resulthigh[0] );