Struggling to Interface MRAM with Arduino Nano

Hello everyone,

I am trying to interface an MRAM chip with an Arduino Nano, but I have been having no luck.

As far as I have been told, these MRAM chips use the same instructions as SRAM and FRAM chips, so they should be a drop in replacement, but I have not been able to get it to work at all.

I have attached a schematic of what I am using; Nothing special, just standard SPI with a level shifter since the chip is a 3.3V on a 5V Arduino. I do not think it is wrong, but I could have definitely made a mistake.

I am actually trying to replace a FRAM chip, which works perfectly using the Adafruit SPI FRAM library, but I have not been able to find a library that can correctly communicate with this chip. It seems that I need to change the manufacturer ID, Product ID, and send this chip different commands compared to the FRAM it is replacing, but I am not sure where to start.

If anyone can help to point me in the right direction I would really appreciate it. I do not think I am adept enough to create my own library from scratch, so any starting libraries would be immensely helpful.

Thanks!

MRAM Chip: https://www.everspin.com/family/mr25h256
FRAM Chip being replaced: https://www.fujitsu.com/uk/Images/MB85RS64V.pdf

I took a quick look at the datasheet and both seems to have the same OP-codes. The MRAM doesn't have the RDID (read device ID) the FRAM does so it might be failing at that part of the library.

Even the status register bits are identical, albeit named differently. So it does look like a drop-in replacement.

Well, that library pretty clearly explicitly checks for whether it is one of a small number of specific parts. Your device doesn't even have the command to ask for those pieces of information, so of course it's going to fail...

It looks like the library even tries to print errors to serial reporting as much!

Are you seeing any errors spit out like that?

baseing line numbers on the version at Adafruit_FRAM_SPI/Adafruit_FRAM_SPI.cpp at master · adafruit/Adafruit_FRAM_SPI · GitHub

you want to delete lines 89 through 106

Thank you guys so much, you were absolutely right. I somehow completely missed the fact that the FRAM has a RDID, whereas the MRAM does not. I am not sure why this is the case, but after removing these checks from the FRAM library, everything works as expected.

For anyone who stumbles upon this problem in the future: You can use the Adafruit FRAM SPI library with MRAM chips. All you need to do is remove the checks for the RDID.

Thanks once again to both DrAzzy and hzrnbgy! You guys are awesome!