A short program to demonstrate the use of interrupts and the serial port to receive RFID card numbers's. Each number is transmitted as a 12 character sequence with a fixed start and stop char.
The ISR disables the RFID unit when the first character is detected to prevent it from reading the card multiple times.
This is nearly identical to the code I am using with my RFID controlled lock. Not included is comparison of id's, the addition and removal of valid ID's from NV memory (EEPROM or FLASH).
Code is attached.
Note: To be a bit more robust the ISR should be modified to detect the stop character as the last character prior to declaring the packet ready.
The ISR disables the RFID unit when the first character is detected to prevent it from reading the card multiple times.
This is nearly identical to the code I am using with my RFID controlled lock. Not included is comparison of id's, the addition and removal of valid ID's from NV memory (EEPROM or FLASH).
Code is attached.
Note: To be a bit more robust the ISR should be modified to detect the stop character as the last character prior to declaring the packet ready.