From 3592862bcbf849a18beab46da2e902973bbfe9fb Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Wed, 10 Oct 2018 15:03:21 +0200 Subject: [PATCH] Improve hardware based reset --- src/MFRC522.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/MFRC522.cpp b/src/MFRC522.cpp index 265f25c..bf733aa 100644 --- a/src/MFRC522.cpp +++ b/src/MFRC522.cpp @@ -204,6 +204,8 @@ void MFRC522::PCD_Init() { if (digitalRead(_resetPowerDownPin) == LOW) { // The MFRC522 chip is in power down mode. pinMode(_resetPowerDownPin, OUTPUT); // Now set the resetPowerDownPin as digital output. + digitalWrite(_resetPowerDownPin, LOW); // Make shure we have a clean LOW state. + delayMicroseconds(2); // 8.8.1 Reset timing requirements says about 100ns. Let us be generous: 2μsl digitalWrite(_resetPowerDownPin, HIGH); // Exit power down mode. This triggers a hard reset. // Section 8.8.2 in the datasheet says the oscillator start-up time is the start up time of the crystal + 37,74μs. Let us be generous: 50ms. delay(50);