Building a project using two Arduinos, bough of them read an RFID-tag and send the UID-code to the other card threw a nrf24l01 radio antenna. At first, I programmed everything in the loop so the sequence started with reading the rfid, than sending rfid over radio and at last looking for received radio. Bough sending from radio and reading the rfid takes a while. Therefore, I want to use the IRQ-pin on the rfid-module so bough of the Arduinos are listening on the radio until the rfid-module interrupt and send the UID-code. Is there someone who knows how to set up the IRQ-pin on the rfid-module? I use MRFC522 card reader and the library from github. Code examples would be appreciated ![]()
on datasheet:
The MFRC522 indicates certain events by setting the Status1Reg register’s IRq bit and, if
activated, by pin IRQ.
so the IRQ must be enabled:
The MFRC522 can generate an interrupt signal when:
• ComIEnReg register’s LoAlertIEn bit is set to logic 1. It activates pin IRQ when
Status1Reg register’s LoAlert bit changes to logic 1.
• ComIEnReg register’s HiAlertIEn bit is set to logic 1. It activates pin IRQ when
Status1Reg register’s HiAlert bit changes to logic 1.
if there isn't library that activate IRQ you need do it manually, writing in the correct MFRC register
I think that the library that I use from github includes IRQ, but I don’t know how to find it in there. I noticed that the text turns blue in the Arduino software when I write ComIEnReg and Status1Reg. I want the IRQ to go high when I read a card, so I might want to use IRqInv for IRQ if I read the datasheet right. How do I write in the register manually?
for understand if in the library is there the command that you need you can open the library and study it, it is open source ![]()
for write in the registry of the rfid you must read the datasheet, an example for write directly in the arduino MCU you can write this
PORTB=0b0001000;
in the same way you can write in the rfid registry