Abstract
: This paper introduces the AT88RF256 RF card reader/writer for 125 kHz low frequency, which is developed by combining the AT-RFMOD06 series RF base station module of Beijing Willimxing Company with the PIC16 type single chip microcomputer. The paper focuses on the hardware connection of the base station module and how to complete the reading and writing of RF cards through the base station, and gives the corresponding application software.
Keywords
: RF card reader/writer; AT88RF256; PIC single chip microcomputer; design
1 Introduction
With the development of computers and embedded systems, IC cards have been integrated into people's daily lives and developed into several major categories. Among them, the emergence of contactless IC cards has attracted special attention. Radio frequency cards belong to contactless IC cards. They avoid physical contact between ordinary IC cards and card readers, reduce card wear, and are widely welcomed. Radio frequency cards are also one of the components of radio frequency identification (RFID) systems.
Radio frequency identification (RFID) technology is an automatic identification technology that emerged in the 1990s. It uses wireless radio frequency to conduct non-contact two-way communication and exchange data to achieve identification purposes. A typical RFID system consists of an electronic tag (Tag), a reader/writer (Read/Write Device), and a data exchange and management system. Electronic tags, also known as radio frequency cards, have intelligent reading and writing and encrypted communication capabilities.
2 System working principle and hardware design
The RFID card reading and writing system designed by the author consists of a computer, a reader and a RFID card. The system structure is shown in Figure 1.
2.1 RFID card reader
The RFID card reader is mainly composed of a PIC16 single-chip microcomputer and an AT-RFMOD06 series RF base station module produced by Beijing Willimxing Company. The module uses a common U2270B contactless card reader base station circuit. The circuit integrates an energy transmission circuit consisting of an on-chip power supply, an oscillator, and a coil exciter to provide working power to the RFID card; it also integrates a signal amplification and antenna drive circuit to complete the signal transmission and reception between the RFID card and the RFID card. The interface circuit between AT-RFMOD06 and PIC16 is shown in Figure 2.
The pin functions of the AF-RFMOD06 module are shown in Table 1. The module uses a single-row 9-pin package and integrates analog circuits such as clock, RF driver, filter, amplifier, modulation and demodulation. Therefore, after connecting the digital interface circuit according to Figure 2, you only need to select the appropriate antenna and resonant capacitor to complete the design of the RF circuit.
In Figure 2, the base station antenna and the oscillation capacitor form an LC oscillation circuit. The system requires that the oscillation frequency generated is limited to 125 kHz (±5%). The antenna's oscillation amplitude can reach up to 120 V, generally not more than 80 V. The antenna's oscillation amplitude can be adjusted by a resistor connected in series with the antenna coil. The withstand voltage of the oscillation capacitor should be greater than 100 V. After repeated debugging, the parameters are set to C=2 200 DF, L=680μ H, and R=82Ω.
2.2 AT88RF256 RF card
The AT88RF256-12 card is an induction card based on a 125 kHz operating frequency launched by ATMEL, USA, which can encrypt and store 256 bits of data. As a typical low-frequency, encrypted and readable and writable card, AT88RF256-12 has a wide range of application prospects in the market. AT88RF256-12 consists of a circuit and a coil. The internal structure of the circuit is shown in Figure 3.
The L1 and L2 pins of the circuit are connected to the coil. When the inductance of the coil is 10.1 mH, the operating frequency of the card is 125 kHz. Its working power is provided by the LC oscillation storage generated by the internal coil and the circuit built-in capacitor. When the AT88RF 256-12 was designed, the capacitor was built into the circuit, which not only reduced the processing links of the card, but also improved the yield and reliability of the module and the card. The electric energy generated by the LC oscillation is converted by the power circuit in the card and provided to the control part and the EEPROM unit respectively.
3 Encoding and decoding and software flow
3.1 Registers and commands of RFID card
The EEPROM inside the card is divided into 10 pages. Each page contains 32 bits, and its contents are shown in Table 2.
The user's card operations include reading the card, writing the card, checking the password, stopping the card, etc. The above operations must be performed according to the following 7 command formats:
0A2A1A010: Write the 32-bit EEPROM of page A2A1A0;
0A2Al A001: Read the 32-bit EEPROM of page A2A1A0;
000011: Data solidification command (8 bits);
010011: Write card control bit command (24 bits):
000111: Write card password command:
011000: Stop card command:
011100: Check password command.
3.2 Key points of radio frequency card control
3.2.1 Coding requirements
AT88RF256 card uses MILLLER code to read the card and MANCHESTER code to write command data in the default state. Under initialization, the width of Miller code element is. 128μ8, Manchester code element width is 256μs.
3.2.2 Time to send command
In order for the reader to send a command to the card, in addition to the card entering the RF field to obtain energy, the sending time is also limited. After the card enters the RF field, it sends data to the reader in a loop in the following format: start bit; 32~152 bits of ID data (length can be set by yourself); stop bit; 8-bit listening window.
Figure 4 shows the output waveform of the DATA OUT pin of the base station module. There is a listening window with a low level state of 8 bits of Miller code element width between each data packet. Only in the 2nd to 7th bit of the listening window can the radio frequency receive the read and write commands sent by the reader. Therefore, a key to this design is how to capture the listening window, which is part of the card reading and decoding operation. Decoding is based on the waveform analysis of the DATA OUT pin of the base station module.
3.2.3 Sending command format
The base station selects the command to be sent to the RFID card from the seven command formats as needed. When sending a command with data, a bit check bit is added at the end of the command. The check bit is the odd check of the command word and all parameters. After receiving the command, the card will compare the parity check bit. Only when the check bit is correct will the command be truly executed, otherwise the ID will be returned and the command will not be executed. This can effectively avoid the wrong operation of the card data due to spatial interference. It greatly improves the reliability of card reading and writing.
3.2.4 Multiple card conflicts
During the development process, when multiple cards enter the field at the same time, the waveform of the DATAOUT pin is equivalent to the superposition of the waveforms when several cards enter the field separately, and it is impossible to select a certain card for reading and writing. In this case, in order to avoid the operation of writing the card by mistake, wait until it is detected that only the only card is in the field before performing the required operation.
3.3 Program design
It is known that the Miller code element width is 128μs, the length of the card ID is 32 bits, and the command can only be sent from the 2nd to the 7th bit of the listening window. The following is a listening window program written by PIC microcontroller. The OUT pin of the RB port inputs the signal of the DATA OUT pin of the base station module, refer to Figure 2. If an error occurs, 5AH is returned, and if it is correct, OH is returned.
LISTEN: MOVLW . 80
MOVWF CARDDEL.
LISLOOP: MOVIJW . 70
MOVWF D1
BTFSC RB,OUT
GOTO LISTEN2
LISTEN1:NOP
BTFSC RB,
OUT
GOTO LISTEN0
DECFSZ D1.1
GOTO LISTEN1
RETLW OH
LISlEN2:NOP
BTFSS RB
,OUT
GOTO LISTIEN0
DECFSZ D1,1
GOTO LJSTEN2
RETLW 5AH
LISTEN0:DECFSZ CARDDEL,1
GOTO LISLOOP
RETLW 5AH
On the basis of correctly tracking the listening window, take the Manchester encoding format to write 32-bit data to the 5th page of the radio frequency card as an example, as shown in Figure 5. Every time a certain page of 32-bit data is successfully written, the card cyclically sends the newly written data until the card is withdrawn. This makes it convenient for users to verify the written data.
4 Conclusion
Since the base station module integrates the modulation and demodulation functions, the communication only needs to focus on the processing of the baseband signal, which reduces the design difficulty. This set of RFID card readers has been applied to the prepaid energy meter system, replacing a batch of ordinary IC card meters that were originally used. The reliability of the system has been recognized by users, and the RFID card is easy to operate. The application prospects of this system are very promising.
Previous article:Multi-machine parallel communication based on MCU
Next article:Intelligent temperature control meter with communication port based on 89C52 single chip microcomputer
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- The reason why there is a big difference in efficiency between electromagnetic excitation motors and permanent magnet motors
- Do you also design a power supply for pulse loads in this way? If you have any questions, please come in~
- 111 uses of Tektronix 3 Series MDO mixed domain oscilloscopes. Do you know them all?
- Talk about the MSP430 library about UART asynchronous serial port
- lvds(1440*540) pointer
- I would like to ask how you learn this tutorial on circuit design based on operational amplifiers and analog integrated circuits.
- Share the method of setting the serial port baud rate of MSP430
- [RISC-V MCU CH32V103 Review] - 3: USART - Why did all three serial port tools fail?
- Bluetooth Protocol Analysis_Basic Concepts
- What do RF engineers do all day?