cancel
Showing results for 
Search instead for 
Did you mean: 

Non Volatile RAM (F-RAM & NVSRAM)

HA_4701186
New Contributor

Hello,

I'm trying to read the device ID in FM25V20A-PG by sending 1001 1111b using an Arduino nano.

The problem is that all I get back is 0xFF on the MISO line. Can some help me find a solution?

I have all my connections according to the datasheet. I have pin WP and DNU connected to VDD. I also tried changing the SPI frequency speed but nothing helped.

Settings in my code:

SPI_MODE0

MSBFIRST

Here is my Arduino code: (In the code I'm trying to see the first 3 bytes of the device's ID)

#include<SPI.h>

const int chipselect=10;

const byte RDID=0b10011111;

byte v=0x00;

void setup() {

  // put your setup code here, to run once:

  Serial.begin(9600);

  pinMode(chipselect, OUTPUT);

  digitalWrite(chipselect, HIGH);

  Serial.print("Chip Select: ");     Serial.println( digitalRead(chipselect), BIN);   //To show Chip select pint status in the serial monitor

  delay(20);

SPI.begin();

SPI.setBitOrder(MSBFIRST);

SPI.setDataMode(SPI_MODE0);

SPI.setClockDivider(SPI_CLOCK_DIV128);

digitalWrite(chipselect, LOW);

delay(1);

Serial.print("Chip Select: ");     Serial.println( digitalRead(chipselect), BIN);     //To show Chip select pint status in the serial monitor

v=SPI.transfer(RDID);

Serial.println(v, BIN);

v=SPI.transfer(0x00);

Serial.println(v, BIN);

v=SPI.transfer(0x00);

Serial.println(v, BIN);

v=SPI.transfer(0x00);

Serial.println(v, BIN);

digitalWrite(chipselect, HIGH);

Serial.print("Chip Select: ");     Serial.println( digitalRead(chipselect), BIN);   //To show Chip select pint status in the serial monitor

SPI.end();

}

void loop() {

  // put your main code here, to run repeatedly:

}

Here is the output I get

serial_monitor.JPG

Logic.JPG

0 Likes
1 Reply
PradiptaB_11
Moderator
Moderator

Hi,

1) Can you try to read the complete device ID and share the result along with the wave forms.

2) Are you able to read/write to the device.

3) Are you powering the device as per the datasheet specifications?

Thanks,

Pradipta.

0 Likes