1 Reply Latest reply on Mar 31, 2020 1:02 AM by RakshithM_16

    RFID-RC522 with PSOC4 verification system


      Hello everyone i am currently working on a project to read a RFID-Tag with the RFID-RC522 module. What i'm basically trying to do is to make a kind of verification system so that when a card with the right UID is scanned i can print a message "verified user" on a I2C lcd display.


      The part of the display is completely working however i'm stuck on how i can do the reading part i know it's really easy with Arduino but i want it with my Psoc4. If someone made something similar or anyone that can help me would be very much appreciated.


      I put my project in the attachments

        • 1. Re: RFID-RC522 with PSOC4 verification system

          Hi AbSe_3753401,


          Can you please let me know what is the issue that you are facing? If you are not able to find the exact issue, can you enter debug mode and check if the project is getting stuck at any time during execution? I do not have the sensor with me at the moment. So, I was not able to debug your project. However, I did go through the project. Can you please let me know if you developed the RC522.c file?

          It appears to me that only the PCD_WriteRegister, PCD_WriteRegisters, PCD_ReadRegister and PCD_ReadRegisters functions use the underlying SPI driver to communicate with the sensor. Please correct me if I am wrong.


          The RFID module also has an IRQ pin which lets the MCU know when it detects an RFID tag. I was not able to find this pin used in your project. The main.c function calls the SPI_Start(), but I also found PCD_Init() function which was not used in the main function to initialize the RC522 sensor. PCD_Init() calls the SPI_Start() internally.


          Can you also try the following things and let me know if it helps?

          1. In PCD_WriteRegisters and PCD_WriteRegister functions can you clear the RxBuffer if the received data is not being used? If the RxBuffer is full then the master will not be able to read data from the slave.

          2. Similar to the 1st point, ensure that there is always some data in TxBuffer, even if it is dummy data, whenever reading from the slave. If TxBuffer is empty then the read will not be successful.

          3. Can you change the wait condition to - while (0u == (SPIM_ReadTxStatus() & SPIM_STS_SPI_DONE)); and let me know if it makes any difference?

          4. You can also use SPI_PutArray() in PCD_WriteRegisters.


          Please refer to SCB_SpiCommSlave CE and these threads -

          PSOC 4 RC522 RFID Reader, SPI communication SCB mode problems

          hello all,

          RFID interfacing with PSOC 5LP

          mfrc522 library for psoc 5lp?


          Thanks and Regards,

          Rakshith M B