Design of AT88RF256 RFID Card Reader

Publisher:WhisperingWishLatest update time:2011-03-14 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Reference address:Design of AT88RF256 RFID Card Reader

Previous article:Multi-machine parallel communication based on MCU
Next article:Intelligent temperature control meter with communication port based on 89C52 single chip microcomputer

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号