FRAM-X Add-on
| Current: | 0.1 mA
*100 kHz mode |
| FRAM: | 0.512 kB
*4 kBit = 512 bit x 8 |
| I2C: | Yes
*up to 1 MHz |
| Voltage: | 3.3 V |
|
BoardX Motherboard |
|
AVR-X Add-on |
|
ADC-X Add-on |
|
PROTO-X Add-on |
|
|
Make: Electronics (Learning by Discovery) |
|
|
Making Things Talk: Using Sensors, Networks, and Arduino to see, hear, and feel your world |
512 bytes of non-volatile, ultra-lower power memory via I2C, which directly replaces EEPROM and FLASH.
FRAM is short for Ferroelectric RAM. This module is non-volatile (retains data without power) and is a drop-in replacement for EEPROM and Flash on an I2C Bus.
We have a free Arduino Library, and ANSI C code examples available here: FRAM-X Code Examples
FRAM is backward compatible with EEPROM but with the following improvements:
- It's faster (1 ns read/write)
- Lower power (microamps at 3.3V)
- Orders of magnitude greater write-erase cycles
- Reference: http://en.wikipedia.org/wiki/Ferroelectric_RAM
Some project ideas include:
- Memory for robots to preserve previously acquired data
- Pre-computed look-up tables for complex mathematical functions
- Scratch memory to expand a processor's available RAM
This Add-on comes with 3 address selection switches as well as a write-disable switch. Pin compatible chips are also available in higher memory densities.
Diagrams and Schematics:
Hook up your AVR-X Add-on and FRAM-X and paste the following into the Arduino SDK to get started, or check out FRAM-X Code Examples for a more detailed step-by-step guide.
#include <Wire.h>
#include <FRAMX.h>
/*Initialize the FRAM and use the default
FRAM address that's provided */
FRAMX fram(FRAMX::FRAMX_I2C_DEFAULT_ADDRESS);
/* read and write buffers here are used to store incoming and outgoing data */
static unsigned char read_buffer[2] ={0x00,0x00};
static unsigned char write_buffer[2]={0x00,0x01};
void setup(){
/* we must call this before using any I2C functions! */
Wire.begin();
Serial.begin(9600);
}
void loop(){
/* memory address to begin with on FRAM */
unsigned char start_address = 0;
/* do not exceed the length of your read and write buffers */
unsigned char number_of_bytes_to_transfer = 2;
/* Write some stuff! */
unsigned int number_of_bytes_written = fram.write(start_address, write_buffer, number_of_bytes_to_transfer);
/* Read some stuff! */
unsigned int number_of_bytes_read = fram.read(start_address, read_buffer, number_of_bytes_to_transfer);
/* Print what we got */
for(int i=0; i<number_of_bytes_to_transfer; i++){
Serial.print("Wrote: ");
Serial.print(write_buffer[i], HEX);
Serial.print(" Read back: ");
Serial.print(read_buffer[i], HEX);
Serial.println(" ");
}
/* Handle any I2C errors */
unsigned int error = fram.errors();
Serial.print("Error code: ");
Serial.print(error,HEX);
switch(error)
{
case 0: Serial.print(" [Success!] ");
break;
case 1: Serial.print(" [Data too large for buffer] ");
break;
case 2: Serial.print(" [I2C Address was not found] ");
break;
case 3: Serial.print(" [Data was not acknowledged] ");
break;
default:Serial.print(" [There was some other error] ");
break;
}
Serial.println(" ");
delay(5000);
}
FRAM Datasheet
FRAM-X Code Examples