RFID Mifare using PIC18F26K40
I'm having trouble reading MIFARE cards using the MFRC522 module.
I know where the problem is, but I don't know how to fix it.
I am able to communicate with the module via SPI. When I call the function to identify if there is a card, it transmits the 0x26 byte to the antenna and waits to receive a byte from the card. However, she is not receiving anything, even with the card next to the antenna.
attached is the code for a part of the main. I didn't put the configuration pins, because I think everything is ok
if( MFRC522_isCard( TagType ) )
if( MFRC522_ReadCardSerial( &UID ) )
attached is the library code
(the problem is in the MFRC522_ToCard function. After executing the command, it loops, waiting for a bit from the COMMIRQREG register to be set, indicating that a data has been received.
But even with the card, it receives nothing (the loop ends without setting the bit in the register))