As part of the CE Header project from the CE Skills course , I decided to add an IC that used SPI to the SensorBoard. I chose the MB85RS64V chip. This is a Ferroelectric Random Access Memory (FRAM) integrated circuit. It is similar to FLASH, but with some added benefits. The idea is to be able to write data to it and the data will persist between power off and power on cycles. I used a Bus Pirate (Dangerous Prototypes) and probes, from Seeed Studio, to iteratively poke at it until I understood how to talk to it via SPI.
Once I soldered the MB85RS64V to a small carrier board from Adafruit, I placed it on a breadboard and wired it up to the Bus Pirate. Please note, the cable and connectors in the image below are from the Seeed probe cable. Some of the other probe cables have the colors in a different order on the connectors.
I used putty to connect to the Bus Pirate via a mini usb cable.
Command | What it does |
M 5 1 1 2 1 2 2 |
Make sure the mode number you use is for SPI |
W | Turn on power, don’t forget this. If you try to access the FRAM chip before this, you will likely hang the Bus Pirate and have to unplug/plug,setup. |
Command | What it does | Output | ||||||||||||||||||
[ 0b10011111 r:4 ] | Read Chip ID | 0x04 0x7F 0x03 0x02
|
Command | What it does | Output |
[ 0b00000101 r:1 ] | Read the register | 0x00 (default) |
Command | What it does | Output |
[ 0b00000011 0 0 r:5 ] | Read 5 bytes starting at address 0x00 0x00 (msb first) | 0x00 0x00 0x00 0x00 0x00
Bytes are initialized to 0 from the manufacturer |
[ 0b00000011 0 0 r:8192 ] | Read all of the bytes from the chip | … |
Command | What it does | Output |
[ 0b00000110 ] | Write Enable | |
[ 0b00000010 0x1F 0xFF 0x11 ] | Write 5 bytes starting at address 0x1F 0xFF (msb first) | Note: the very last byte is at address 0x1F 0xFF |
[ 0b00000100 ] | Write Disable | |
[ 0b00000011 0x1F 0xFF r:1 ] | Read the data back from address 0x1F 0xFF | 0x11 |
Command | What it does | Output |
[ 0b00000110 ] | Write Enable | |
[ 0b00000010 0x00 0x00 0x01 0x02 0x03 0x04 0x05] | Write 5 bytes starting at address 0x00 0x00 (msb first) | Note: the very first byte is at address 0x00 0x00 |
[ 0b00000100 ] | Write Disable | |
[ 0b00000011 0x00 0x00 r:5 ] | Read the data back from address 0x00 0x00 | 0x01 0x02 0x03 0x04 0x05 |
Go ahead and power off with the w command, unplug the USB from the Bus Pirate, plug it back in. Go through the set up steps and re-read the data, it should still be there!
It turns out that Adafruit sells this chip ready to go on a breakout board along with an Arduino library!