MFRC63002 13.56MHz Card Reader not operated

cancel
Showing results for 
Search instead for 
Did you mean: 

MFRC63002 13.56MHz Card Reader not operated

1,297 Views
avirutthiengsun
Contributor I

I had tried MFRC630 for card reader 13.56MHz via SPI interface . I setting hardware as "CLEV633B_Blueboard_3v0_sch"

Power,Vdd,Pvdd,Tvdd,Dvdd,Avdd ,And SEL0=0,SEL1=1,IF0=MOSI,IF1=SCK,IF2=MISO,IF3=NSS as recommend but not respond anything. 

For Software I write get version for  MFRC630 but but not respond anything. 

Comparation,  I change IC to RC522 I can get version and read tag is normal operation.

I'd like to know, How to check MFRC630 working or not. Hardware,Software setting important point  ?

please advice to me.

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

// Uncomment This for 630
#define MFRC630

// CHANGE HERE 0x37 FOR 522 and 0x7F FOR 630
// 630
#ifdef MFRC630

#define MFRC630_REG_VERSION 0x7F // 630 : 7Fh Datasheet Page 55 Expect Result 80
#define versionAddressFinal (MFRC630_REG_VERSION << 1) | 0x01 // Datasheet 7.4.2.4
#else
// 522
#define MFRC630_REG_VERSION 0x37 // 522 : 37h Datasheet Page 39 Expect Result 92
#define versionAddressFinal 0x80 | MFRC630_REG_VERSION << 1 // Datasheet 8.1.2.3
#endif

#define CHIP_SELECT 10
#define RST 9

void setup() {
// Start serial communication.
Serial.begin(9600);
// Set the chip select pin to output.
pinMode(CHIP_SELECT, OUTPUT);
digitalWrite(CHIP_SELECT, HIGH);
pinMode(RST, OUTPUT);
digitalWrite(RST, LOW);
delay(1000);
digitalWrite(RST, HIGH);

// Start the SPI bus.
SPI.begin();
delay(1000);
}

void loop() {
// call the above function until infinity.
// PCD_WriteRegister();
byte v = PCD_ReadRegister();
Serial.print(String(millis()) + " ");
Serial.print(F("Firmware Version: 0x"));
Serial.print(v, HEX);
// Lookup which version
switch (v) {
case 0x88: Serial.println(F(" = (clone)")); break;
case 0x90: Serial.println(F(" = v0.0")); break;
case 0x91: Serial.println(F(" = v1.0")); break;
case 0x92: Serial.println(F(" = v2.0")); break;
default: Serial.println(F(" = (unknown)"));
}
// When 0x00 or 0xFF is returned, communication probably failed
if ((v == 0x00) || (v == 0xFF))
Serial.println(F("WARNING: Communication failure, is the MFRC properly connected?"));
delay(2000);
}

byte PCD_ReadRegister() {
byte value;
Serial.print("TF Reg HEX: ");
Serial.println(MFRC630_REG_VERSION, HEX);
Serial.print("TF Hex: ");
Serial.println(versionAddressFinal, HEX);
Serial.print("TF BIN: ");
Serial.println(versionAddressFinal, BIN);
SPI.beginTransaction(SPISettings(SPI_CLOCK_DIV4,MSBFIRST ,SPI_MODE0));
digitalWrite(CHIP_SELECT, LOW); // Select slave
delay(1);
SPI.transfer(versionAddressFinal);
value = SPI.transfer(0); // Read the value b Serial.println("TF Reg: " + String(reg, HEX));
digitalWrite(CHIP_SELECT, HIGH); // Release slave again
SPI.endTransaction(); // Stop using the SPI bus
return value;

}

0 Kudos
1 Reply

502 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello avirut,

There are some differences between MFRC630 and MFRC522 (e.g. SPI address format), which seem to be addressed by your code definitions, but it is hard to say if something is still wrong with your code because I am not familiar with Arduino sources.

If you have validated that all the connections are in place (VDD source, IFSEL0 / IFSEL1 pins, MOSI/MISO/SCK/NSS), then you need to inspect the bus with an oscilloscope or logic analyzer to see if the intended SPI frames are actually transmitted. Indeed reading the version register is a good starting point.

Regards!

Jorge Gonzalez

0 Kudos