Compared with traditional contact IC cards and magnetic cards, the contactless IC reader developed using RFID technology has great advantages in system life, anti-eavesdropping, anti-decryption, etc. This article introduces a contactless dedicated IC reader built using MCU P89LPC932, MF RC632, Mifare card, etc., which fully utilizes the functions of the MF RC632 RFID reader chip.
Most of the devices used are from PHILPS, which are typical and have a certain degree of versatility. Therefore, they can be applied to other systems with a slight modification. Moreover, based on this reader/writer, it is easy to develop a contactless IC identifier suitable for various automatic identification systems. 1 System hardware structure and working principle 1.1 System structure and characteristics The system mainly consists of the core control unit MCU P89LPC932, MF RC632 for communicating with Mi-fare One card, RS232 for communicating with PC, real-time clock chip PCF8563 for providing time reference and memory AT45DB021 for storing system setting data. The devices used in the whole system are relatively common devices, which are typical and universal. In addition, in the system design, the whole system is divided into master station and base station, and the hardware and software of the master station and base station are the same, only the settings are different. Therefore, as long as the device is installed, its permissions can be set through the PC, which is easy to install, debug, maintain and expand. 1.2 System hardware and working principle The system hardware block diagram is shown in Figure 1. After the mainboard is powered on, the system settings in the memory are read, and then the entire system is initialized according to the settings, including the device ID number, master station, slave station, power-on time, power-off time, data storage method, etc. In addition to being a general Mifare card reader, this system can also be used as a training device and a dedicated training evaluation tool. For example, the device is installed around the runway and the Mifare One card is installed on the tester's shoes. Because each trainer has his own ID number, when he starts from the starting line, the dedicated card reader installed at the starting line will write the trainer's device ID number and the time at that time into the tester's Mifare One card. When passing the next base station, the card reader will write the tester's device ID and the time at that time into the tester's Mifare One card, and at the same time, the tester's ID number, name and other personal information, including the time of passing the last test base station, will be read into the device for storage. Since the Mifare One card has 16 sectors, each sector is divided into four blocks, and each block has 16 bytes, in addition to the sector space used by the system, users can use 48×16 bytes. The data stored in the Mifare One card is not large and only occupies one storage area. In other words, the data storage area of the Mifare One card can store 48 times. When it exceeds 48 times, the data will be overwritten from the front. Therefore, the information stored in the Mifare One card is always the information of the last 48 base stations. After the training is completed, the data of each base station can be collected through the master station to evaluate the information of the tester. There are also various communication methods between the master station and the base station: when the distance between the master station and the base station is relatively close, RS232 and RS485 can be used; to improve the communication quality, the industrial bus method can be used, such as CAN bus, FC bus or One Wire bus; when the distance is relatively far, wireless communication methods such as GSM can be used. In addition, each base station can also output data through a printer [1-2]. 2 Key components and key technologies 2.1 Card reader core CPU P89LPC932 P89LPC932 is a single-chip packaged microcontroller produced by Philips. It is suitable for applications that require high integration and low cost, and can meet many performance requirements. It uses a high-performance processor structure, and the instruction execution time only takes 2 to 4 clock cycles, which is six times that of the standard 80C51 device; it integrates many system-level functions. Its functional block diagram is shown in Figure 2 [3]. 2.2 Mifare MF RC632 Highly Integrated Contactless Communication Card Reader IC Mifare MF RC632 is a contactless smart card and tag launched by Philips for working frequency of 13.56MHz, and supports multiple ISO contactless standards in this frequency band, including ISO1443 and ISO15693. MF RC632 enables system integrators to develop interoperable RFID systems conveniently and flexibly by changing the RF signal amplitude of different reading applications including public transportation, road tolling, access control programs and supply chain management. The new reader IC uses a special modulation and demodulation concept, which can change the amplitude of the RF signal, can identify various RFID-based smart cards, logos and tags, and supports ISO1443 and ISO15693 standards. Its design is pin-to-pin compatible with Philips' existing reader ICs, including Mifare smart card reader IC MF RC632, TYPE-B card reader IC MF RC531 and I.CODE smart tag reader IC SL RC400. The IC card parallel interface can be directly connected to any 8-bit microprocessor, providing great flexibility in the design of the reader/terminal. In addition, the SPI bus it provides provides an effective solution for some designs with limited I/O resources. 2.3 Real-time clock chip PCF8563 PCF8563 is a low-power CMOS chip that can be programmed to have clock output, interrupt output and low voltage detection functions. All addresses and data are transmitted via the serial I2C bus with a maximum rate of 400kbps. The built-in word address register automatically adds 1 after each read and write. The main features are as follows: Provides year, month, day, hour, minute, second and century markings based on a 32.768Hz crystal oscillator; provides a wide operating voltage range from 1V to 5V; low holding current, only 0.25μA at 25°C and 3V power supply; 400kHz I2C bus as an external interface; can be programmed as a clock source for external devices, with four clock types: 32.768kHz, 1024Hz, 32Hz and 1Hz; has alarm and timer functions; low voltage detection; internal crystal oscillator capacitor and power-on reset circuit; I2C bus; open collector output[5]. 3 Design Implementation 3.1 Hardware (1) System power supply circuit Since the ultimate design goal of this system is to make a handheld device, battery power is selected for power supply. In order to reduce the power consumption of the entire circuit board, in addition to selecting low-power devices in device selection, some simple circuits are also used in power supply design to achieve power management. As shown in Figure 3, the entire power supply circuit is divided into three parts. The battery voltage is input through the connector BATTER, and the voltage of about 6V is reduced to 5.3V after passing through D3. The 5.3V voltage outputs a voltage of about 5V after passing through VT4 to supply the 5V circuit on the board. VT4 is controlled by the system's control core CPU. The 5.3V voltage passes through the power module to the power supply circuit. AS1117 constitutes a 3.3V power supply circuit to power the control core P89LPC932 on the circuit board. The 3.3V voltage outputs a power supply voltage of about 3V after passing through VT2, which powers other 3V circuits on the board. In addition to the system's control core being powered in this way, the power supply of other circuits is completely controlled by the system's control core P89LPC932 through software, which greatly reduces the system's power consumption and improves power efficiency. (2) System control core The circuit is shown in Figure 4. The control core of the whole system uses the high-speed 51 series products produced by PHILPS. By utilizing its rich internal resources, it not only reduces the design difficulty but also improves the reliability of the system in PCB manufacturing. (3) RF circuit The circuit is shown in Figure 5. In this design, in order to improve the scope of use of the entire system, the more powerful MFRC632 is used in chip selection, which is also the core part of the entire system. (4) System clock circuit The system clock circuit is shown in Figure 6. In this system, in order to save the system's I/O resources, a high-performance clock chip of the I2C bus is selected, and its internal power detection circuit is used to monitor the system's power supply battery. [page] (5) Antenna design Since the frequency of MF RC632 is 13.56MHz, which belongs to the shortwave band, a small loop antenna can be used. There are square, circular, elliptical, triangular and other small loop antennas. This system uses a square antenna. There is no strict limit between the maximum geometric size of the antenna and the working wavelength, which is generally defined as: L/λ≤1/2π (1) In the above formula, L is the maximum size of the antenna, and λ is the operating wavelength. For a 13.6MHz system, the maximum size of the antenna is about 50 cm. In antenna design, the quality factor Q is a very important parameter. For the PCD antenna of the inductively coupled RFID system, a higher quality factor value will increase the current intensity in the antenna coil, but this can improve the power transmission to the PICC. The calculation formula of the quality factor is: Q=(2πf0·Lcoil)/Rcoil (2) It can be seen from formula (3) that the transmission bandwidth of the antenna is inversely proportional to the quality factor. Therefore, a too high quality factor will reduce the transmission bandwidth, thereby weakening the modulation sideband of the PCD, resulting in the PCD being unable to communicate with the card. The best quality factor of a general system is 10 to 30, and the maximum value cannot exceed 60. Considering the above factors and the convenience of implementation, the antenna is formed by winding a square wire on the outermost side of the PCB board. The circuit schematic is shown in Figure 7, and the antenna PCB circuit is shown in Figure 8. (6) Data storage circuit The data storage circuit is shown in Figure 9. In this system, in order to save the system hardware resources and increase the system data storage capacity, the 264KB Flash AT45DB021 with SPI bus interface produced by ATMEL is used to store system settings and backup data. 3.2 Software 3.2.1 Mifare card operation process The whole system consists of two parts: Mifare card operation and system background processing. Due to limited space, this article only briefly introduces the operation process of Mifare card, and its operation process is as follows: (1) Reset request When a Mifare card is within the working range of the card reader antenna, the programmer controls the reader to send a REQUEST all (or REQUEST std) command to the card, the card's ATR will start, and the card type (TagType) number in the card Block 0, a total of 2 bytes, will be transmitted to the reader, establishing the first step of communication between the card and the reader. If the reset request operation is not performed, the reader will not perform other operations on the card. (2) Anti-collision operation If there are multiple Mifare cards within the working range of the card reader antenna, the PCD antenna will communicate with each card to obtain the serial number of each card. Since each Mifare card has a unique serial number (never the same), the PCD antenna will ensure that only one card is operated at a time based on the serial number of the card. This operation enables the PCD antenna to obtain the return value of the PICC as the serial number of the card. (3) Card selection operation After completing the above two steps, the PCD antenna must select the card. After executing the operation, the SIZE byte on the card is returned. (4) Authentication operation After the above three steps, it is confirmed that a card has been selected. Before the PCD antenna can read and write the card, it must also authenticate the password set on the card. If they match, the read and write operations are allowed. (5) Read and write operations The write operation is the final operation on the card, including read, write, increment, decrement, storage and transmission operations. 3.2.2 Partial code of system software According to the above process, Keil C language is used for programming. Due to limited space, this article only briefly introduces part of the code of the header file of the card reader program, mainly introducing some functional functions to be used in the program: The operation process of most radio frequency cards is similar to that of Mifare cards, and the operation functions used are also similar. Therefore, as long as a small amount of code of the functions used in this system is modified, it can be applied to other card reader designs. 4 Reliability Countermeasures Since this system is a standard RFID card reader device, its electromagnetic compatibility must be specially controlled. The method adopted by this system is that, in addition to considering the routing of some signal lines that can cause battery radiation interference on the PCB board, copper is also laid on the circuit board to increase the shielding ability of the ground line to the signal. In addition, more vias are drilled around the circuit board to increase the conductivity of the upper and lower bottom lines, reduce the impedance between the two layers, increase the system's anti-EMC ability, and reduce the system's EMI. The most prominent features of this reader are high performance, high stability and strong compatibility. The typical reading and writing distance is 11 cm. There is no dead zone in the effective reading and writing area, and the reading and writing operation is reliable. In the desktop working environment, the error rate of continuous reading and writing of cards in the effective sensing area is less than 0.01%. Its compatibility is reflected in the ability to read not only standard cards, but also cards that deviate a lot from the standard. At the same time, as a special dedicated card reader with a real-time clock, this system has a wide range of uses in some fields that require timing detection. For example, in pigeon racing competitions, you only need to install this device at the opening of the pigeon cage and install a Mifare card on the pigeon to quickly get the results of the competition. This solution has been successful in a company's equipment, and I believe it can also be developed more widely in other fields. | |||||||||
|
references:
[1]. RS232 datasheet http://www.dzsc.com/datasheet/RS232_585128.html.
[2]. PCF8563 datasheet http://www.dzsc.com/datasheet/PCF8563_318649.html.
[3]. AT45DB021 datasheet http://www.dzsc.com/datasheet/AT45DB021_143086.html.
[4]. RS485 datasheet http://www.dzsc.com/datasheet/RS485_585289.html.
[5]. 80C51 datasheet http://www. dzsc.com/datasheet/80C51_103447.html.
[6]. ISO15693 datasheet http://www.dzsc.com/datasheet/ISO15693_2354384.html.
[7]. AS1117 datasheet http://www.dzsc.com/datasheet/AS1117_140128.html.
[8]. PCB datasheet http://www.dzsc.com/datasheet/PCB_1201640.html.
[9]. PCD datasheet http://www. dzsc.com/datasheet/PCD_1201639.html.
[10]. EMC datasheet http://www.dzsc.com/datasheet/EMC_2342312.html
Previous article:Design of Network Intelligent Instrument
Next article:Intelligent fast charging circuit module design
Recommended ReadingLatest update time:2024-11-23 11:22
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- NMOS tube on-state voltage test problem
- EEWORLD University - How to use independent measurement ADC to design high-precision CT phase meter
- A collection of selected PCB design resources, free points download for a limited time
- MCU model confirmation and decryption
- Current research trends and development directions of new gas sensors (Part 2)
- [Zero-knowledge ESP8266 tutorial] Quick start 25 Blynk control RGB LED
- Need a 10uh inductor, ESR < 0.2Ω, saturation current > 0.8A
- Ti DSP optimization basic strategy
- Everyone cried for 8.5 yuan!
- Hiring embedded software engineer