• AVR Freaks

Hot!RFID Mifare using PIC18F26K40

Author
oleoarruda
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2021/01/07 07:09:11
  • Location: 0
  • Status: offline
2021/01/11 04:29:12 (permalink)
0

RFID Mifare using PIC18F26K40

Hello everyone.
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

MFRC522_Init();

while (1)
{
UART_Write(0x11);
if( MFRC522_isCard( TagType ) ) 
{

UART_Write(0xCC);

if( MFRC522_ReadCardSerial( &UID ) )
{

UART_Write(0xAA);

}
}

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))
 
#1

0 Replies Related Threads

    Jump to:
    © 2021 APG vNext Commercial Version 4.5