Open arseni-mourzenko opened 1 year ago
Hi,
it seems that using hardware reset line appears useless to devs as you can read in the source comments:
// So far just using software based reset had no disadvantage so skip any reset pin related code.
From my own experience, there should be a hardware reset line management for 2 main reasons :
I strongly suggest you to implement this on your own as it's just a matter of pulling reset pin down then up with a short delay in between.
byte _resetPowerDownPin = GPIO_NUM_XXX
void setup()
{
...
pinMode(_resetPowerDownPin, OUTPUT);
...
}
void PCD_Powerdown()
{
digitalWrite(_resetPowerDownPin, LOW);
}
void PCD_PowerUp()
{
digitalWrite(_resetPowerDownPin, HIGH);
}
void PCD_HardReset()
{
digitalWrite(_resetPowerDownPin, LOW);
delayMicroseconds(2); //In order to perform a reset, the signal must be LOW for at least 100 ns => 2us is more than enough
digitalWrite(_resetPowerDownPin, HIGH);
delay(50);
}
I personnally trigger a hardreset every time the microcontroller starts to ensure the chip is always properly working.
Few things to keep in mind after sending a hard reset :
During a hard power-down (using pin NRSTPD), the 25 bytes in the internal buffer remain
unchanged and are only lost if the power supply is removed from the MFRC522.
I didn't do much research on that but it might be a good idea to check how to clear the internal buffer.
Regards
P.S. I hope I'm clear (sorry for my English ;) )
I'm trying to read Mifare Classic 1K cards using Seeeduino Lotus. It works with the original https://github.com/miguelbalboa/rfid library, detecting the card and showing its UID.
However, when I try MFRC522v2 version 2.0.4 and use the sample code from the documentation, it shows:
Note that the wiring is exactly the same in both cases, with the default pins being used, as specified in the documentation. If I upload back the original sketch, it works.
I noticed that the example from the original MFRC522 library specifies both the SPI SS pin and the reset pin like this:
however the example from has only the SS pin specified:
Is this the issue? How do I tell what's the reset pin?