FRAM memory size

I’ve recently been experimenting with FRAM memory. The chip that I got has 8MB although my ESP32 only sees 4MB. However, wen I run a sketch to find I2C devices, it comes back with 2 addresses for the FRAM memory. I’ve tested it and I can write to either of the two halve which are both 4MB.

What I am curious about is why it is 4MB. I’ve done a search, and I can’t find the answer. Is it a limitation of the ESP32, or is it something that is a feature of FRAM memory? Since it has two I2C addresses, I assume that this is a feature of the memory chip.

What is the part number?

Its an MB85RC256V. By the way, its kB not MB.

That is a 32kByte IC.
It has only one address, 0x50
So are you saying you can only write to 16kBytes?

I use them and they are 32K bytes or 32K x 8. What FRAM library are you using? What are the two address you are seeing?

When i run the I2C sketch to find adresses, it came back with 0x50 and 0x7C.
I ran a test on both of them and it reported 32,768 bytes.
Is it just giving an alternative address, but using the same memory?

0x7C (anything above 0x77) is a reserved I2C address. Don't use it.

I'm using FRAM.h library.

I obtained the addresses using this:

/*********
  Rui Santos
  Complete project details at https://randomnerdtutorials.com  
*********/

#include <Wire.h>

#define I2C_SDA 33
#define I2C_SCL 32
 
void setup() {
  Wire.begin(I2C_SDA, I2C_SCL);
  Serial.begin(115200);
  Serial.println("\nI2C Scanner");
}
 
void loop() {
  byte error, address;
  int nDevices;
  Serial.println("Scanning...");
  nDevices = 0;
  for(address = 1; address < 127; address++ ) {
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
    if (error == 0) {
      Serial.print("I2C device found at address 0x");
      if (address<16) {
        Serial.print("0");
      }
      Serial.println(address,HEX);
      nDevices++;
    }
    else if (error==4) {
      Serial.print("Unknow error at address 0x");
      if (address<16) {
        Serial.print("0");
      }
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0) {
    Serial.println("No I2C devices found\n");
  }
  else {
    Serial.println("done\n");
  }
  delay(5000);          
}

This is the result, Ox3C is an OLED

Scanning...

I2C device found at address 0x3C

I2C device found at address 0x50

I2C device found at address 0x7C

done

Something is wrong, as jim-p states It has only one address, 0x50. Can you post a schematic showing how this is connected?

That is the FRAM
What else is conected to the I2C bus?

This is the card
image

Just 4 wires Vcc, Gnd, SCL and SDA connected.

The only thing that I think is non-standard is that I have refefined the SDA and SCL.

#define I2C_SDA 33

#define I2C_SCL 32

Wire.begin(I2C_SDA, I2C_SCL);

It could be a hardware bug or "feature" in the FRAM, that it responds to a reserved I2C address.

Again, don't use 0x7C and the problem is solved.

1 Like

That is correct for the FRAM at 0x50.
Don't know what the 0x7c is.

I was using the 0x7C, just because that's where I ended up after playing around with it when I first got it.

I've just changed it to the 0x50 and re-uploaded the sketch. I half expected to find that all the data that I had stored would be gone, but it is still there.

I have had a few instances whilst I have been experimenting where the data has got corrupted, I assumed it was my programming but perhaps it was the 0x7C address that was causing the problem.

The MB85RC256V does indeed respond to 0x7C.
It is the address used to retrieve the device ID
Nothing bad will happen if you access that address.
Mystery solved

1 Like

So it is my programming then.

So it is my programming then.

Regarding what?
The FRAM has 32K bytes of RAM and you access it at address 0x50

The data sheet does not state that it is possible or safe to write data to the FRAM using address 0x7C.

Use address 0x50 to write data and if data corruption still occurs, then you do have a problem with the device, the wiring or the code.