Search code examples
c#raspberry-pi2iotwindows-10-iot-corewindowsiot

Two RFID RC522 Raspberry PI 2 Windows IOT


What should I change in a class from topic RFID RC522 Raspberry PI 2 Windows IOT if I want to connect second rfid reader via SPI?

I connected the second "ss line" to SPI_CE1_N pin and "reset line" to GPIO12 pin.

I added a constructor in class Mfrc522 and I used SPI_CONTROLLER_NAME, SPI_CHIP_SELECT_LINE, RESET_PIN as a parameters but without success.


Solution

  • Finally I solved the problem.

    Thank You Rita Han for your help. Your code now work great. Now because I had hardware problem.

    I connected devices as a picture:

    Connection RFID-RC522 to the Raspberry Pi.

    After connecting the oscilloscope noticed that the voltage of MISO bus is not correct. Both devices pulling down the voltage to ground. Instead of 3,3V was barely 1,24V. (The minimum voltage for 3,3V CMOS logic level 1 is 2,4V)

    One of the devices trying to transmit.

    To quickly test I used two diodes (for separating outputs) and resistor (to speed up the falling edge).

    Solution - separation output.

    Result: 3,3V - Vf = 2,56V

    Result - separation output.

    Now both devices working great.

    I think that ultimately it would be better to use SN74HC125N.

    BTW: Why can not change the SS pin by property?

    _spi.ConnectionSettings.ChipSelectLine = 1;