How to interface RFID with PIC18F4550 Microcontroller

RFID (Radio Frequency Identification and Detection) is widely used everywhere from highly secured defense laboratories to school attendance system. By employing RFID, much secured entry systems can be developed without incurring huge costs. These are the reasons of excessive use of RFID technology. In this article, interfacing of an RFID reader module has been explained with PIC18F4550. The USART interrupt, an internal PIC interrupt, has also been explained. (For more details on USART, refer PIC EUSART)
As explained earlier (refer RFID interfacing with 8051 & with AVR), an RFID module consists of an RFID Reader, a line converter (usually MAX232) and a COM port. The line converter of this module converts the TTL logic voltage of RFID Reader to RS232 logic. Therefore, to convert the voltage level from such an RFID module, another MAX232 is used to interface it with a microcontroller.
RFID with PIC
One can also use an RFID Reader directly to interface with the controller, thus avoiding the need of voltage level converters. Here both the MAX232s have been eliminated from the circuit and RFID reader is directly connected with the PIC microcontroller.
 
The following table explains the pin diagram of the RFID Reader module.
Pin No.
Name
Description
1
Vcc
Supply Voltage; 5V
2
GND
Ground (0V)
3
BEEP
Beep or LED drive
4
ANT
No Use
5
ANT
No Use
6
SEL
High is RS232, Low is Weigand
7
RS232
TTL output data
8
D1
Weigand Data 1
9
D0
Weigand Data 0
Another part of the RFID system is RFID tag, which contains 12 bytes of unique data. As the tag comes in the range of the Reader Module, it gets activated and transmits this unique code. (For more detail on working of RFID system, refer the article on RFID) The objective here is to receive this 12 byte unique code and display on a 16×2 LCD using PIC18F4550.
With the RFID interfacing, this article also explains the USART interrupt which is an internal interrupt. (For external interrupts, refer PIC Hardware interrupts) The internal interrupts, unlike hardware interrupts, are associated with internal peripherals of the controller. To use the USART interrupt, following registers have to be configured accordingly.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.