MB85RC1MT 128k x 8 FRAM Chip 17 bit access

I’m using the “MB85RC.class.nut:1.0.0” library to access the MB85RC1MT 128k x 8 FRAM chip. I am having trouble writing data beyond address 64k (16 bits). Everything works fine below 64k, but I can’t access the upper half of the chip’s memory.

After a closer look at the data sheet, this version of the MB85RC chip series is slightly different. First off, it only has two external address pins (A1 and A2) so only four chips can be on the same I2C bus. Along with that, the 17th address bit is buried in the device address word. What that means is that in order to get to the upper half of the memory, you need to use the successive I2C address. So for A1 and A2 equal 0, the lower half of the chip is addressed at A0 and the upper half of the chip is addressed at A2.

I don’t think the “MB85RC.class.nut:1.0.0” library takes that into account, after reviewing the code on GitHub. Is that why I’m having trouble?

I wrote that library quite some time ago, but I can say it wasn’t written with that chip’s (then unknown) behaviour in mind.

What you might be able to do is use two instances, one for each of the two I2C address/memory blocks and combine them with the Framstore library, which was designed to simplify aggregating multiple FRAMs across a single address space.

Hi smittytone,
I’m able to access the upper and lower half of the MB85RC1MT FRAM chip using the MB85RC library, but have no success with the Framstore library. Even trying to write a 4 byte blob to location 0 and then read it back doesn’t work. Looks like you are reading and writing bytes in Framstore and reconstructing the blobs. Any tips?

Let me dig out the hardware and have a look.

Closer inspection reveals the bug! Fortunately, it’s easy to fix, and I’ll file a ticket to get this done.

In the meantime, what you should probably do is paste the FramStore code from the GitHub repo into your code. You need to change line 113 from:

b.writen(v, 'b');


b.writen(v[0], 'b');

That should cause your blobs to be read back correctly.

We’re in business! That fixed the FramStore problem.

Below is how I added the two halves of the 128k x 8 chip into FramStore:

f1 = MB85RC(HW_I2CA, 0xA0, 512); // 128k x 8 chip
f2 = MB85RC(HW_I2CA, 0xA2, 512); // 128k x 8 chip
FRstore = FramStore([f1, f2], true);

Notice that I have to set it up as two 512k bit chips instead of a single 1024k bit chip.

Thanks for all your help smittytone!