Description
This small board mounts a non-volatile MB85RC256V 256M-bit / 32MB FRAM chip with I2C interface.
FRAM (Ferroelectric Random Access Memory) can be used like EEPROM or Flash for non-volatile storage but is better in just about every way.
Unlike EEPROM or Flash, FRAM has almost unlimited read/write endurance of at least 1 trillion cycles. Data retention is also very long depending on temperature. This makes FRAM ideal for logging applications which require frequent or continuous updating of the data on the chip. If a data byte on the chip is updated every millisecond, it would take almost 32 years to reach 1 trillion write cycles.
It can also be written at full bus speed which in this case is up to 1Mhz over I2C without required polling as with EEPROM in order to verify the write or erasing pages before rewriting them. You simply write over the existing data like you would with SRAM.
PACKAGE INCLUDES:
- MB85RC256V 256M-bit FRAM Module
- 1×8 male header
KEY FEATURES OF FRAM 32K I2C MODULE:
- 32MB (256 M-bit) memory organized as 32K x 8 bytes
- I2C Interface with built-in 10K pullup resistors
- Up to 1MHz clock rate
- Minimum of 1 trillion read/write cycles per byte
- Long data retention of 200 years @ 35°C, 95 years @ 55C, 10 years @85C
- Low power
- 3.3V & 5V compatibility
Module Connections
The connections to the module are fairly simple.
- Supply 3.3V or 5V power to match the microcontroller and ground.
- Connect the I2C interface.
- Optional Write Protect and Address lines can be used if needed.
1 x 8 Header
- VCC = 2.7 to 5.5V. Typically connected to 3.3V or 5V to match microcontroller power.
- GND = Ground connects to microcontroller ground.
- WP = Write Protect. Internally pulled low to enable writing. Tie it to Vcc if you want to disable writing to the chip.
- SCL = Clock – connects to I2C SCL.
- SDA= Data – connects to I2C SDA.
- A2 = Address bit 2. Internally pulled low
- A1 = Address bit 1. Internally pulled low
- A0 = Address bit 0. Internally pulled low
I2C Bus
The module operates over I2C at bus speeds of up to 1MHz. The maximum speed will mainly depend on the microcontroller that it is used with. An Uno or other slower 16-bit microcontrollers for instance will typically be limited to 400kHz, while faster 32-bit microcontrollers like Teensy or ESP32 can support up to 1MHz.
The module has built-in 10K pullup resistors on the I2C lines. In our testing using 4″ jumper wires, we were able to run up to the maximum 1MHz speed with no issues. If you are pushing the speed and using long wiring you many encounter data errors. If that happens, you can try adding stronger pullups such as 2.2K resistors. These can be added in parallel with those already on the module.
Addressing
The base address of the module is 0x50.
There are 3 address lines marked A0-A2 which can be used to change the base address if needed and allows for up to 8 of these modules to be used on the same I2C bus by setting each of them to a different address.
These pins are pulled low internally. To change the address, tie the address pins to Vcc. This gives an address range of 0x50 to 0x57. If the A0 pin is tied to Vcc, the address of the module is 0x51 and so on.
OUR EVALUATION RESULTS:
These modules have good build quality and performed well in our testing. The built-in pullup resistors and bypass capacitor along with the 3.3V and 5V compatibility make them very easy to connect up to the microcontroller.
As noted above, FRAM modules are better in almost every way compared to older technologies like EEPROM or Flash except that they are more limited in size, at least compared to Flash, and can get quite expensive in the larger sizes. These particular modules are kind of in the sweet spot of being fairly cost friendly while also providing a decent amount of storage space that is adequate for many common applications. The I2C interface, while not as fast as SPI versions does make connecting things up very simple and is fast enough for most common logging requirements.
This module is our new go-to for our own logging requirements, especially where frequent or constant updates are required.
There are a number of libraries available for working with FRAM memory. With the Arduino IDE, we use the FRAM_I2C library by Rob Tillaart that can be downloaded from the IDE Library Manager. https://github.com/RobTillaart/FRAM_I2C
The program below is based on the testFRAMPerformance example program that comes with the library. It has been modified to test at 100kHz, 400KHz and 1MHz I2C bus speeds and increases the size of the data used for testing. We are using a Teensy 4.1 for our testing which supports 1MHz I2C. If you are running this on something relatively slow like an Uno, you should comment out the 1MHz test section of the code.
Some microcontrollers will allow the I2C bus speed to be set to somewhat arbitrary values. The Teensy 4.1 we are using likes the standard bus speeds of 100kHz, 400kHz or 1MHz only.
Simply connect the power and ground pins to the microcontroller power and ground and connect the SCL/SDA I2C pins to the same on the microcontroller. The WP and Address lines can be left unconnected.
FRAM 32KB Speed Test Program
/*************************************************************************
Modified version of testFRAMPerformance.ino
AUTHOR: Rob Tillaart/ modified by Ken Hahn
PURPOSE: test FRAM at 100KHz, 400KHz and 1MHz speeds
URL: https://github.com/RobTillaart/FRAM_I2C
Note: This is setup for running on Teensy or other 32-bit fast
processors that can support 1MHz I2C speeds. If using a slower
Arduino like Uno, comment out the 1MHz test. 16-bit processors
will also write 10,000 bytes instead of 20,000 since their INT is
2 bytes instead of 4 bytes
*****************************************************************************/
#include "FRAM.h"
FRAM fram;
uint32_t start;
uint32_t stop;
int ar[5000]; // == 20,000 bytes for 32-bit processor, 10,000 bytes for 16-bit
//===============================================================================
// Initialization
//===============================================================================
void setup() {
Serial.begin(115200);
Wire.begin();
int rv = fram.begin(0x50);
if (rv != 0) {
Serial.println(rv);
} else {
//Test 100KHz I2C Bus Speed
uint32_t speed = 100000UL;
Serial.print("CLOCK: ");
Serial.println("100KHz");
Wire.setClock(speed);
testReadWriteLarge();
//Test 400KHz I2C Bus Speed
speed = 400000UL;
Serial.print("CLOCK: ");
Serial.println("400KHz");
Wire.setClock(speed);
testReadWriteLarge();
//Test 1MHz I2C Bus Speed
speed = 1000000UL;
Serial.print("CLOCK: ");
Serial.println("1MHz");
Wire.setClock(speed);
testReadWriteLarge();
}
Serial.println("done...");
Serial.println();
Wire.setClock(100000);
}
//===============================================================================
// Main - Does nothing as everything is done in Setup
//===============================================================================
void loop() {
}
//===============================================================================
// testReadWriteLarge subroutine does all the actual work
//===============================================================================
void testReadWriteLarge() {
int size = 5000 * sizeof(int);
for (int i = 0; i < 5000; i++) ar[i] = i;
// Write 20000 bytes to FRAM and measure time
start = micros();
fram.write(1000, (uint8_t*)ar, size);
stop = micros();
Serial.print("WRITE 20,000 bytes TIME: \t");
Serial.print(stop - start);
Serial.print(" us ==> \t");
Serial.print((stop - start) / (1.0 * size), 2);
Serial.println(" us/byte.");
delay(100);
for (int i = 0; i < 5000; i++) ar[i] = 0;
// Read 20000 bytes from FRAM and measure time
start = micros();
fram.read(1000, (uint8_t*)ar, size);
stop = micros();
Serial.print("READ 20,000 bytes TIME: \t");
Serial.print(stop - start);
Serial.print(" us ==> \t");
Serial.print((stop - start) / (1.0 * size), 2);
Serial.println(" us/byte.");
delay(100);
// Check to see if data was read back correctly
bool test_Passed = true;
for (int i = 0; i < 5000; i++) {
if (ar[i] != i) {
Serial.print("FAIL: \t");
Serial.print(ar[i]);
Serial.print('\t');
Serial.println(i);
test_Passed = false;
}
}
if (test_Passed) Serial.println("PASSED");
Serial.println();
}
BEFORE THEY ARE SHIPPED, THESE MODULES ARE:
- Sample inspected and tested per incoming shipment
Notes:
- None
Technical Specifications
| Operational Ratings | ||
| Vcc | 2.7 – 5.5V (3.3V or 5V typ) | |
| Operating Current | Typical | 200uA @1MHz, 27uA standby |
| Interface | I2C | |
| Clock Rate | Maximum | 1MHz |
| Write/Erase Cycles | Minimum | 1,000,000,000,000 (1 trillion) |
| Memory Configuration | 32K x 8 bits (256K-bit) | |
| Data Retention | 200 years @35°C, 95 years @ 55°C, 10 years @85°C | |
| Country of Origin | China | |
| Datasheet | RAMXEED | MB85RC256V |




