RFID Chip MFRC522 driver
Diff: MFRC522.cpp
- Revision:
- 2:3c7304e9b934
- Parent:
- 1:63d729186747
--- a/MFRC522.cpp Mon Jan 06 15:00:15 2014 +0000 +++ b/MFRC522.cpp Sun Jan 23 05:09:21 2022 +0000 @@ -248,11 +248,14 @@ { /* Reset MFRC522 */ m_RESET = 0; - wait_ms(10); + //wait_ms(10); + ThisThread::sleep_for(10ms); + m_RESET = 1; // Section 8.8.2 in the datasheet says the oscillator start-up time is the start up time of the crystal + 37,74us. Let us be generous: 50ms. - wait_ms(50); + //wait_ms(50); + ThisThread::sleep_for(50ms); // When communicating with a PICC we need a timeout if something goes wrong. // f_timer = 13.56 MHz / (2*TPreScaler+1) where TPreScaler = [TPrescaler_Hi:TPrescaler_Lo]. @@ -279,7 +282,8 @@ // The datasheet does not mention how long the SoftRest command takes to complete. // But the MFRC522 might have been in soft power-down mode (triggered by bit 4 of CommandReg) // Section 8.8.2 in the datasheet says the oscillator start-up time is the start up time of the crystal + 37,74us. Let us be generous: 50ms. - wait_ms(50); + //wait_ms(50); + ThisThread::sleep_for(50ms); // Wait for the PowerDown bit in CommandReg to be cleared while (PCD_ReadRegister(CommandReg) & (1<<4))