CrazyBi7
Posts: 1
Joined: Thu Feb 21, 2019 9:54 am

Change Pins RFID-MFRC522 Module

Sun Sep 22, 2019 9:07 am

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?

Bope
Posts: 71
Joined: Sat Jul 06, 2019 2:57 am

Re: Change Pins RFID-MFRC522 Module

Sun Sep 22, 2019 1:39 pm

Your issue is you need to use SPI or I2C to control the module. These pins are fixed on the RPi.

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Change Pins RFID-MFRC522 Module

Sun Sep 22, 2019 4:05 pm

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

172pilot
Posts: 12
Joined: Wed Mar 06, 2013 9:10 pm

Re: Change Pins RFID-MFRC522 Module

Mon Jul 20, 2020 8:39 pm

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!!

Return to “Beginners”