I'm working on a project with an Arduino Mega that uses Wiegand RFID readers, and I need to use hardware interrupts for the D0 and D1 lines of each reader. I know that on the Mega, only pins 2, 3, 18, 19, 20, and 21 are hardware interrupt-capable, which limits the number of readers I can connect.
Is there any way to add more interrupt-capable pins or expand the hardware interrupts for handling more RFID readers?
In addition to the "external" interrupts (INT0 to INT7) there are a large number of pin change interrupts, which are hardware, but less flexible in interrupt conditions. See Interrupts - Section 14 of the data sheet.
I moved your topic to an appropriate forum category @onlinegill .
In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.
Hi @jremington Thank you for your response. When I connect D0 and D1 pins to 2, 3, 18, 19, 20, and 21, I am able to read a Wiegand 26-bit card. However, if I switch to different pins, it does not work.
You are using pins which don't support pin change interrupts. See this list from the "Read Me" section of the library you are using of supported pins for pin change interrupts.