Search code examples
c++arduinorfid

Communication failure RFID reader and Arduino uno wifi rev 2


All similar questions, don't solve my problem

its possible that Rfid ≪Mfrc522.H≫ Won't Work With New Arduino Uno Wifi Rev2 ¿? SPI interface is the same that Rev 3 ¿?

I have a problem with the RFID reader and Arduino uno wifi rev 2. When I connect and run the program, it says

Firmware Version: 0x0 = (unknown)WARNING: Communication failure, is the MFRC522 properly connected?


#include <SPI.h>
#include <MFRC522.h>

#define RST_PIN         9          
#define SS_PIN          10         

MFRC522 mfrc522(SS_PIN, RST_PIN);  

void setup() {
    Serial.begin(9600);     
    while (!Serial);        
    SPI.begin();            
    mfrc522.PCD_Init();     

    mfrc522.PCD_DumpVersionToSerial();  // Show details of PCD - MFRC522 Card Reader details
    Serial.println(F("Scan PICC to see UID, SAK, type, and data blocks..."));

...more code...
}

  1. The cables are connected correctly. (I'm sure, and it's welded)
  2. has always been connected to a 3.3V output
  3. I have followed the documentation as indicated.
  4. I have tried with another motherboard and the same thing happens.
  5. The arduino works correctly.
  6. I have changed the cables in case they were defective.

the cables are arranged as follows

Any Idea? Thanks!!


Solution

  • I have solved the problem. I will try to explain it as best as possible

    The location of the SPI interface in Arduino wifi rev 2 is different from versions rev 3 and 1

    "One of the significant differences between the Uno and the Uno WiFi Rev2 is that the Uno has the SPI bus pins broken out on pins 11-13 as well as on the 2x3 pin ICSP header. On the Uno WiFi Rev2, the SPI bus is only broken out on the 2x3 ICSP header. This means that if you had the MFRD522 connected to pins 11-13 on your Uno and you tried to use the same wiring on your Uno WiFi Ref2, it won't work."

    So if your model is Arduino uno wifi rev 2 the wires connected to pins 11, 12, 13 will need to be moved to the ICSP pins. (They are the 2x3 pins that are at the bottom of the arduino). Due to this migration the SPI interface is located on those pins. the rest of the connections do not touch them, leave them as in the previous image.

    ICSP

    MISO (1) SCK (3) MOSI (4)

    :)