Page 1 of 1

Change Pins RFID-MFRC522 Module

Posted: Sun Sep 22, 2019 9:07 am
by CrazyBi7
Hello Guys,
I need help with a my project.
I would use a RFID MFRC522 Module (Datasheet https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf ) with my Raspberry Pi 3 B+, but many pins are busy (from pin 1 to pin 26).
Can I use other pins for this module?

Re: Change Pins RFID-MFRC522 Module

Posted: Sun Sep 22, 2019 1:39 pm
by Bope
Your issue is you need to use SPI or I2C to control the module. These pins are fixed on the RPi.

Re: Change Pins RFID-MFRC522 Module

Posted: Sun Sep 22, 2019 4:05 pm
by joan
If your MFRC522 module uses SPI (likely) and your software can use the auxiliary SPI device then it should work but you will have to use chip select 2.

Code: Select all

Aux SPI   MISO  MOSI  SCLK   CE0  CE1   CE2
GPIO       19    20    21    18   17    16
Pin        35    38    40    12   11    36

Re: Change Pins RFID-MFRC522 Module

Posted: Mon Jul 20, 2020 8:39 pm
by 172pilot
I'm having a similar issue -
I was doing an RFID project and was using code based on this:
https://pimylifeup.com/raspberry-pi-rfid-rc522/

I got everything working, but I also need to use some i2c devices, for which I was hoping to use Sparkfun's QWIIC hat:
https://www.sparkfun.com/products/14459

My problem is that pin22 isn't one of the ones exposed by the hat, which the code as written needs for the reset pin. I thought I could just move reset to pin 26 (GPIO 7) and change it in the code:
I changed this:
if pin_rst == -1:
if pin_mode == 11:
pin_rst = 15
else:
pin_rst = 22

to this:

if pin_rst == -1:
if pin_mode == 11:
pin_rst = 15
else:
pin_rst = 26

but.. It's not working at all now.

Anyone know of another reason switching pins would have failed here? I can't help but think it's got something to do with the pinmode here, and I am ALSO supposed to edit the 15, but I can't find anything that correlates the 22 to the 15 in the pinout (ie: pin22 says it's GPIO25, so I could see if the 15 was a 25 in the sample code, I'd have to change it to 7, since pin26 is GPIO7, but can find no such correlation)

I kind of just expected this to work and Im confused!!

Thanks in advance!!