The FRAM chip is the little guy in the middle. On the bottom we have the power and interface pins
- VCC - this is the power pin. Since the chip uses 3-5VDC you should pick whatever the logic voltage you're using. For most Arduino's that's 5V.
- GND - common ground for power and logic
- WP - Write Protect pin. This is used to force write protection so you cannot write to the FRAM. It has an internal pulldown. Bring to a high voltage (VCC) to turn on WP
- SCL - I2C clock pin, connect to your microcontrollers I2C clock line.
- SDA - I2C data pin, connect to your microcontrollers I2C data line.
A2, A1, A0 - These are the I2C address selection pins. By default the I2C address is 0x50. Connecting these pins to VCC and power cycling the chip will adjust the lower three bits of the address. For example, if A0 is high, the address is 0x51. If A1 and A2 are high, the address is 0x56
Prepare the header strip:Cut the strip to length if necessary. It will be easier to solder if you insert it into a breadboard - long pins down
Add the breakout board:Place the breakout board over the pins so that the short pins poke through the breakout pads
And Solder!Be sure to solder all pins for reliable electrical contact.
(For tips on soldering, be sure to check out our Guide to Excellent Soldering).
You're done! Check your solder joints visually and continue onto the next steps
Wiring and Test
Connect Vcc to the power supply, 3V or 5V is fine. Use the same
voltage that the microcontroller logic is based off of. For most
Arduinos, that is 5V
- Connect GND to common power/data ground
- Connect the SCL pin to the I2C clock SCL pin on your Arduino. On an UNO & '328 based Arduino, this is also known as A5, on a Mega it is also known as digital 21 and on a Leonardo/Micro, digital 3
- Connect the SDA pin to the I2C data SDA pin on your Arduino. On an UNO & '328 based Arduino, this is also known as A4, on a Mega it is also known as digital 20 and on a Leonardo/Micro, digital 2
Place the Adafruit_FRAM_I2C library folder your arduinosketchfolder/libraries/ folder.
You may need to create the libraries subfolder if its your first library. Restart the IDE.
We also have a great tutorial on Arduino library installation at:
The test is fairly simple - It first verifies that the chip has been found. Then it reads the value written to location #0 in the memory, prints that out and write that value + 1 back to location #0. This acts like a restart-meter: every time the board is reset the value goes up one so you can keep track of how many times its been restarted.
Afterwards, the Arduino prints out the value in every location (all 256KB!)
You can create the FRAM object with
Adafruit_FRAM_I2C fram = Adafruit_FRAM_I2C();Then when you begin(), pass in the i2c address. The default is 0x50 so if you don't put any value in the default is used.
If you have different addresses, call something like
Then to write a value, call
fram.write8(address, byte-value);to write an 8-bit value to the address location
Later on of course you can also read with
fram.read8(address);which returns a byte reading.