2

I'm wondering where the pin setting is manifested in the library. I want to use the RC522 with other digital pins than the default 50-53 pins, because I am using a shield for a display on theese ports.

Where can I change the used ports? why are two ports user-defineable #define RFID_SS 10 #define RFID_RST 5 while the rest is not?

I am with this Playground-Guide using this library from Github on my Arduino Mega

1
#define RFID_SS  10

stands for Slave Select on port 10, the SPI is a serial interface, meaning you can connect all kinds of SPI devices to the same wires, as long as slaves have different IO ports.

This is also the reason you don't need to define the other ports because they need to be connected to your SPI.

I suggest you make yourself familiar with this page: http://arduino.cc/en/Reference/SPI

To sum it up. You can change the reset and Slave Select pin out, (those set in the variables) but not the SPI Pins. But you can use the ISCP pins in the middle of the board.

  • so I can either use ISCP on my board for MOSI MISO SCK. Or I connect the display shield to pins 50-53 and at the same time connect the RFID'sMISO / MOSI / SCK to the same ports 50-53 and the select/reset pins do the rest (choosing where to send data to) for me? – Joel Feb 19 '15 at 11:14
  • Yes that is correct. Also be aware that some libraries (lib) have the SS pin hard-coded, this is solved by going in to the library and change the value to a variable set through the function. – Magic-Mouse Feb 19 '15 at 12:17
1

SPI The RFID_SS pin is the slave select pin. So you can have another arduino pin for a LCD_SS select. Having RfID_SS =low - talk to RFID. Having LCD_SS =low talk to LCD via MISO. Note: Drive other slave select High otherwise they'll both get the data. Having only one device in communication at a time. Cheers Nik V

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.