Improve hardware based reset
This commit is contained in:
@@ -204,6 +204,8 @@ void MFRC522::PCD_Init() {
|
|||||||
|
|
||||||
if (digitalRead(_resetPowerDownPin) == LOW) { // The MFRC522 chip is in power down mode.
|
if (digitalRead(_resetPowerDownPin) == LOW) { // The MFRC522 chip is in power down mode.
|
||||||
pinMode(_resetPowerDownPin, OUTPUT); // Now set the resetPowerDownPin as digital output.
|
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.
|
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.
|
// 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);
|
delay(50);
|
||||||
|
|||||||
Reference in New Issue
Block a user