![]() Status = MFRC522_ToCard(PCD_TRANSCEIVE, recvData, 4, recvData, &unLen) Uchar MFRC522_Read(uchar blockAddr, uchar *recvData) Status = MFRC522_ToCard(PCD_AUTHENT, buff, 12, buff, &recvBits) Verification instructions + block address + sector password + card sequence number Uchar MFRC522_Auth(uchar authMode, uchar BlockAddr, uchar *Sectorkey, uchar *serNum) If ((status = MI_OK) & (recvBits = 0x18)) Status = MFRC522_ToCard(PCD_TRANSCEIVE, buffer, 9, buffer, &recvBits) ClearBitMask(Status2Reg, 0x08) //MFCrypto1On=0 wait for completion of CRC calculation Write_MFRC522(FIFODataReg, *(pIndata+i)) SetBitMask(FIFOLevelReg, 0x80) // clear FIFO pointer Void CalulateCRC(uchar *pIndata, uchar len, uchar *pOutData)ĬlearBitMask(DivIrqReg, 0x04) //CRCIrq = 0 SetBitMask(CollReg, 0x80) //ValuesAfterColl=1 Status = MFRC522_ToCard(PCD_TRANSCEIVE, serNum, 2, serNum, &unLen) Write_MFRC522(BitFramingReg, 0x00) //TxLastBists = BitFramingReg SetBitMask(ControlReg,0x80) //timer stops Serial.println("Read from the card ,the data is : ") Status = MFRC522_Auth(PICC_AUTHENT1A, blockAddr, Status = MFRC522_Write(blockAddr, writeDate) Serial.print("set the new card password, and can modify the data of the Sector: ") Status = MFRC522_Write(blockAddr, sectorNewKeyA) Status = MFRC522_Auth(PICC_AUTHENT1A, blockAddr, sectorKeyA, serNum) // authentication Serial.println("The card's number is : ") Status = MFRC522_Request(PICC_REQIDL, str) Uchar blockAddr //Select the address of the operation 0~63 PinMode(NRSTPD,OUTPUT) // Set digital pin 10, Not Reset and Power-down PinMode(chipSelectPin,OUTPUT) // Set digital pin 10 as OUTPUT to connect it to the RFID /ENABLE pinĭigitalWrite(chipSelectPin, LOW) // Activate the RFID reader Serial.begin(9600) // RFID reader SOUT pin connected to Serial RX pin at 2400bps MF522 Error code returned when communication #define PICC_TRANSFER 0xB0 //Save buffer data #define PICC_RESTORE 0xC2 //Transfer data to buffer #define PICC_AUTHENT1B 0圆1 //Verify B key #define PICC_AUTHENT1A 0圆0 //Verify A key #define PICC_SElECTTAG 0x93 //choose cards #define PICC_ANTICOLL 0x93 //Anti collision #define PICC_REQIDL 0x26 // line-tracking area is dormant #define PICC_REQALL 0x52 //line-tracking area is interfered #define PCD_CALCCRC 0x03 //CRC calculation #define PCD_TRANSCEIVE 0x0C //receive and send data #define PCD_IDLE 0x00 //NO action cancel current command Module uses voltage of 3.3V, and can be directly connected to any CPU boards for communication through the SPI interface using simple few lines, which can guarantee stable and reliable reader distance.Ĭonst int chipSelectPin = 10 //if the controller is UNO,328,168 This module can be loaded directly into a variety of readers molds. ![]() ![]() MRC522 RFID module adopts Philips MFRC522 original reader circuit chip design, easy to use, low cost, suitable for equipment development, development of advanced applications, the need for RF card terminal design/production.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |