Brooke's World The life and ramblings of Brooke.

May 27, 2017

Testing MB85RS64V with Bus Pirate

Filed under: Uncategorized — Brooke @ 1:22 pm

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
Initalize the Bus Pirate
M 5 1 1 2 1 2 2
  • Mode SPI
  • Speed 30khz
  • Clock: Idle low *default
  • Output clock edge: Active to idle *default
  • Input sample phase: Middle *default
  • CS: /CS *default, Output Type: Normal (H=3.3V, L=GND)

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
Read the ID
[ 0b10011111 r:4 ] Read Chip ID 0x04 0x7F 0x03 0x02

Manufacturer 0x04 Fujitsu
Continuation Code 0x7F ?
Product ID – byte 1
  Proprietary (3 left bits) 0b000 ?
  Density (5 right bits) 0b0011 64kbit
Product ID – byte 2 0x02 2

 

Command What it does Output
Read the status register
[ 0b00000101 r:1 ] Read the register 0x00 (default)

 

Command What it does Output
Read memory
[ 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

 

Write 1 byte to memory
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

 

Write 5 bytes to memory
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!

 

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress