Seeeduino Xiao nRF52840 sense and Fujitsu FRAM MB85RS64V

I am trying to use the FRAM MB85RS64V break out on the Seeduino Xiao nRF52840 Sense.
However, the device doesn’t seem to be detecting the FRAM at all.
It works well on the UNO.
I don’t know what is wrong with the setup or code.
Can anyone guide me through this one?

#include <SPI.h>
#include "Adafruit_FRAM_SPI.h"

/* Example code for the Adafruit SPI FRAM breakout */
uint8_t FRAM_CS = 7;

//Adafruit_FRAM_SPI fram = Adafruit_FRAM_SPI(FRAM_CS);  // use hardware SPI

uint8_t FRAM_SCK= 8;
uint8_t FRAM_MISO = 9;
uint8_t FRAM_MOSI = 10;
//Or use software SPI, any pins!
Adafruit_FRAM_SPI fram = Adafruit_FRAM_SPI(FRAM_SCK, FRAM_MISO, FRAM_MOSI, FRAM_CS);

uint16_t          addr = 0;

void setup(void) {
  Serial.begin(9600);
  while (!Serial) delay(10);     // will pause Zero, Leonardo, etc until serial console opens
  
  if (fram.begin()) {
    Serial.println("Found SPI FRAM");
  } else {
    Serial.println("No SPI FRAM found ... check your connections\r\n");
    while (1);
  }
  
  // Read the first byte
  uint8_t test = fram.read8(0x0);
  Serial.print("Restarted "); Serial.print(test); Serial.println(" times");

  // Test write ++
  fram.writeEnable(true);
  fram.write8(0x0, test+1);
  fram.writeEnable(false);

  fram.writeEnable(true);
  fram.write(0x1, (uint8_t *)"FTW!", 5);
  fram.writeEnable(false);

  // dump the entire 8K of memory!
  uint8_t value;
  for (uint16_t a = 0; a < 8192; a++) {
    value = fram.read8(a);
    if ((a % 32) == 0) {
      Serial.print("\n 0x"); Serial.print(a, HEX); Serial.print(": ");
    }
    Serial.print("0x"); 
    if (value < 0x1) 
      Serial.print('0');
    Serial.print(value, HEX); Serial.print(" ");
  }
}

void loop(void) {

}
![image|666x500](upload://fPma2s1TX9rXanNFetcVYvrA8sS.jpeg)

Hi jay98,
So If you are using the Sense version of the Xiao, It already has an SPI flash on the board?
Can you elaborate on what you have connected and how?
Which board files are you using? non-mbed?
HTH
GL :slight_smile: PJ

1 Like

I am trying to do a small data logging device using FRAM.
Seeeduino sense has a built in sensor so I thought it was a good choice to use this device.
I am trying to connect the FRAM and Sense using SPI>
I am using the Adafruit FRAM SPI library.
The way I connect the device is
CS pin 7
SCK 8
MOSI 9
MISO 10
and VDD and GND.

are you sure your master in slave out and master out slave in is connected correctly?
out on the master connected to in on the slave device and vice versa?

The eagle eyes here :star_struck:
Double check, looks as though it should work but the board files and libraries need to work together too.
your close
HTH
GL :slight_smile: PJ

Hi jay98,
Try this.

#include <SPI.h>
#include "Adafruit_FRAM_SPI.h"

/* Example code for the Adafruit SPI FRAM breakout */
uint8_t FRAM_CS = D7;

Adafruit_FRAM_SPI fram = Adafruit_FRAM_SPI(FRAM_CS);  // use hardware SPI

//uint8_t FRAM_SCK= 8;
//uint8_t FRAM_MISO = 9;
//uint8_t FRAM_MOSI = 10;
//Or use software SPI, any pins!
//Adafruit_FRAM_SPI fram = Adafruit_FRAM_SPI(FRAM_SCK, FRAM_MISO, FRAM_MOSI, FRAM_CS);