Summary of RFID interfacing with AVR microcontroller (ATmega16) using interrupts
This article explains how to read a 12-byte RFID tag ID using an AVR microcontroller's serial interrupt and display it on an LCD. Unlike the polling method, interrupts prevent the microcontroller from being busy-waiting, ensuring efficient data handling. The code uses an Interrupt Service Routine (ISR) triggered by the USART_RXC event to store each received byte and immediately write it to the LCD, resetting the counter after every 12 bytes to handle new tags.
Parts used in the RFID Interfacing Project:
- RFID module
- LCD
- AVR microcontroller (ATmega16)
- Serial interrupt mechanism
- Temporary variable for storage
This article covers how to extract and display the twelve byte unique tag ID received by RFID module on LCD using interrupt method. Before proceeding to this article readers must have knowledge of serial interrupt and LCD. In the previous article of RFID, polling method was used where the microcontroller was continuously monitoring the RXC flag. Keeping the microcontroller busy in monitoring the flag is not a good programming technique, so instead of polling method a programmer should prefer using interrupts.
-
Why is the interrupt method preferred over the polling method?
The interrupt method prevents the microcontroller from being continuously busy monitoring the RXC flag, which is considered a poor programming technique. -
What protocol does the RFID module output data use?
The output data of the RFID module uses the RS232 protocol and is serial in nature. -
How many times is the serial interrupt generated for a single tag?
The serial interrupt is generated twelve times because the length of the tag is twelve characters. -
What happens if the ISR executes for too long?
If the ISR takes too long, it may skip data because a second interrupt could be generated before the first one finishes executing. -
When does the code reset the index variable 'i' to zero?
The variable 'i' resets when its value reaches 13, indicating that one complete set of twelve bytes has been processed. -
Where does the display start writing when the variable 'i' is greater than 13?
The incoming serial value starts writing from the 0th position of the second line of the LCD. -
What specific vector is used for the serial interrupt in the code?
The code uses the ISR (USART_RXC_vect) vector for handling the serial interrupt.


