Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RC522 Mini Not Work vs RC522 Normal #603

Open
ruielias opened this issue Jun 19, 2023 · 5 comments
Open

RC522 Mini Not Work vs RC522 Normal #603

ruielias opened this issue Jun 19, 2023 · 5 comments
Labels
hardware 🔌 not a problem with the software

Comments

@ruielias
Copy link

ruielias commented Jun 19, 2023

Step 1: Describe your environment

  • MFRC522 Library version: 1.4.10
  • Arduino device: ESP32-WROOM-32D
  • MFRC522 devices: MW-ET LIVE MINI RFID-RC522 and RFID-RC522

Step 2:

Hello,
I have a full size RC522 module and working 100% OK
I paid for 3 "MW-ET LIVE MINI RFID-RC522" units, and none of them work, but they pass the "PCD_PerformSelfTest()".
Are Minis different?

Affected file(s) or example(s):

self test

Steps to reproduce:

Observed Results:

  • Normal Size RC522 :
MFRC522 Digital self test
Firmware Version: 0x92 = v2.0
Only known versions supported
Performing test...
Result: OK
  • MW-ET LIVE MINI RFID-RC522 :
MFRC522 Digital self test
Firmware Version: 0x92 = v2.0
Only known versions supported
Performing test...
Result: OK

Expected Results:

  • Read on both RC522 types. But I can only read TagID in normal format

Relevant Code:

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

#define SS_PIN  16
#define RST_PIN 13
 
MFRC522 rfid(SS_PIN, RST_PIN);

void setup() {
  Serial.begin(115200);
  while (!Serial);

  SPI.begin(5,19,27,16);
  rfid.PCD_Init(); // init MFRC522
  delay(10);
  Serial.println("Iniciou RFid");
  
  delay(100);

 Serial.println(F("*****************************"));
  Serial.println(F("MFRC522 Digital self test"));
  Serial.println(F("*****************************"));
  rfid.PCD_DumpVersionToSerial();  // Show version of PCD - MFRC522 Card Reader
  Serial.println(F("-----------------------------"));
  Serial.println(F("Only known versions supported"));
  Serial.println(F("-----------------------------"));
  Serial.println(F("Performing test..."));
  bool result = rfid.PCD_PerformSelfTest(); // perform the test
  Serial.println(F("-----------------------------"));
  Serial.print(F("Result: "));
  if (result)
    Serial.println(F("OK"));
  else
    Serial.println(F("DEFECT or UNKNOWN"));
  Serial.println();
}

void loop() {
  if (rfid.PICC_IsNewCardPresent()) { // new tag is available
    Serial.println("NEW...");
    if (rfid.PICC_ReadCardSerial()) { // NUID has been readed
      MFRC522::PICC_Type piccType = rfid.PICC_GetType(rfid.uid.sak);
      Serial.print("RFID/NFC Tag Type: ");
      Serial.println(rfid.PICC_GetTypeName(piccType));
      // print UID in Serial Monitor in the hex format
      Serial.print("UID:");
      for (int i = 0; i < rfid.uid.size; i++) {
        Serial.print(rfid.uid.uidByte[i] < 0x10 ? " 0" : " ");
        Serial.print(rfid.uid.uidByte[i], HEX);
      }
      Serial.println();
      rfid.PICC_HaltA(); // halt PICC
      rfid.PCD_StopCrypto1(); // stop encryption on PCD
    }
  }
  delay(250);
}

image
image

@alex-eri
Copy link

it works if pulldown RST pin. see #599

@alastaira
Copy link

Without seeing the schematic, it sounds like they may have omitted the pullup resistor and/or put an inverter on the RST line. Normally, this pin can be ignored - it's pulled HIGH by default, and you only need write a LOW signal to it to reset the reader. From the description given by @alex-eri , it sounds like you need to do the opposite for this board.

@alex-eri

This comment was marked as outdated.

@alex-eri
Copy link

Not inverted. Pull down needed to make this line of code work
https://github.com/miguelbalboa/rfid/blob/1e73cd34d977c5fe17fa5f2e2e8174650a572028/src/MFRC522.cpp#L210C2-L210C2

else RST pin stays in INPUT mode and FLOATING on many boards ( for example ESP32)

@alex-eri
Copy link

alex-eri commented Nov 28, 2023

pulled HIGH by default only on board without FLOATING input (Arduinos).

@Rotzbua Rotzbua added the hardware 🔌 not a problem with the software label Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hardware 🔌 not a problem with the software
Projects
None yet
Development

No branches or pull requests

4 participants