1 Reply Latest reply on May 14, 2020 12:52 PM by PradiptaB_11

    FM25V20A-PG Read device ID

    HA_4701186

      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