0

Can someone help me what is the meaning of this sketch? It always outputs in the serial monitor:

Firmware Version: 0x1C = (unknown)
Scan PICC to see UID, SAK, type, and data blocks...

This is the code of the MFRC522 library I use:

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

constexpr uint8_t RST_PIN = 9;          // Configurable, see typical pin layout above
constexpr uint8_t SS_PIN = 10;         // Configurable, see typical pin layout above

MFRC522 mfrc522(SS_PIN, RST_PIN);  // Create MFRC522 instance

void setup() {
   Serial.begin(9600);   // Initialize serial communications with the PC
   while (!Serial);    // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
   SPI.begin();      // Init SPI bus
   mfrc522.PCD_Init();   // Init MFRC522
   mfrc522.PCD_DumpVersionToSerial();  // Show details of PCD - MFRC522 Card Reader details
   Serial.println(F("Scan PICC to see UID, SAK, type, and data blocks..."));
}

void loop() {
   // Look for new cards
   if ( ! mfrc522.PICC_IsNewCardPresent()) {
     return;
   }

   // Select one of the cards
   if ( ! mfrc522.PICC_ReadCardSerial()) {
     return;
   }

   // Dump debug info about the card; PICC_HaltA() is automatically called
   mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
}
5
  • The code is quite well commented, what don't you understand? The outputFirmware Version: line is obviously output by PCD_DumpVersionToSerial(). Do you get any other output other than that? You should also see Scan PICC to see.... Are you not seeing that? Please be more explicit, and include a few more lines of output, to illustrate any repetition of output. Jul 3, 2018 at 3:56
  • yes it also output but reader does not read the rfid card nor the rfid key , that is why I assumed that was the error
    – hotchongas
    Jul 3, 2018 at 4:03
  • Try running the firmware_check example. In that sketch, it does say that only known versions are supported (Serial.println(F("Only known versions supported"));), so your first output line doesn't bode well Jul 3, 2018 at 4:18
  • Please add a link to your post, to the library that you are using. Is it this one: github.com/miguelbalboa/rfid? Jul 3, 2018 at 4:23
  • yes, thats the one I use.
    – hotchongas
    Jul 3, 2018 at 4:27

2 Answers 2

1

The mention of unknown in the output line:

Firmware Version: 0x1C = (unknown)

isn't a good sign.

Run the firmware_check example to verify that first, before trying to run other code.

The unknown is output by line 1302 of MFRC522.cpp:

    default:   Serial.println(F(" = (unknown)"));

The firmware_check example states on line 49:

  Serial.println(F("Only known versions supported"));

So, your hardware (i.e. the reader) may not be supported.

The only thing I can suggest is try another reader. Also, read the README, there maybe some thing there, or contact the author and/or raise an issue to see if you can get support for your version of the firmware (0x1C) added.

0

Put a delay(5) after

mfrc522.PCD_Init();   // Init MFRC522

and it will show the correct firmware version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.