Design and implementation of RFID system based on ARM platform

Publisher:美梦小狮子Latest update time:2012-11-13 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1. Introduction

In recent years, RFID (radio frequency) technology is an emerging automatic identification technology. RFID uses radio frequency to conduct non-contact two-way communication to identify objects and transmit the collected relevant information and data remotely through wireless technology. Compared with the currently widely used barcode technology, RFID has the characteristics of long reading distance (several meters to tens of meters), strong penetration ability (can read information directly through the packaging box), anti-pollution, high efficiency (can process multiple tags at the same time), and large amount of information. Its emergence has brought revolutionary impact on industrial applications in logistics and production [1].

It is for the above reasons that this paper proposes a RFID system design and implementation solution based on the ARM platform to meet people's development and application of RFID technology in the embedded field.

2. System Introduction

2.1 System Hardware Design

Hardware system block diagram: As shown in the figure, the processor adopts the most popular ARM series in the current embedded system, specifically the industrial-grade ARM chip of ATMEL. The FLASH is 4M, and the chip used is AM, which is used to store the LINUX kernel, RAMDISK and some system configuration files and test data. The SDRAM is M, and the chip used is MT48LC2M32B2TG-6. The physical layer chip of the network interface adopts RTL8201. It is also equipped with input and output devices, namely LCD display and 5×4 keyboard. The power supply adopts a voltage regulator module to output a stable voltage, and is designed with user-friendly functions such as a single-key switch and a charging circuit [2].



2.2 System software design

We use LINUX as the system operating system. After adding the patch package supporting the ARM series to the standard LINUX, the kernel provides support for AT91RM9200 (we call it ARM-LINUX). Under ARM-LINUX, we write the drivers for keyboard, LCD, network card, and FLASH file system. We write a small and concise GUI (graphical user interface) on ARM-LINUX to make the program more modular, which is convenient for writing upper-level programs and upgrading the system in the future.



3. Hardware circuit design

3.1 Single-key switch circuit design

The following points must be considered in the design of single-key switches: First, the single-key switch must be stable, and pressing the key once will only turn the power on or off once; second, the current problem: because the single-key switch uses power whether it is turned off or on, it must ensure that the current is small enough to reduce power loss. By searching for information.

The working principle of the circuit is: Q8 (2N7000) and Q7 (IRF8540) are N-channel and P-channel field effect transistors respectively, and their turn-on voltages (voltage between GS) are 3V and -2V respectively. When BP17 is released, the voltage between GS of Q8 is very small, Q8 is cut off, and the current at the D end is very small, so the voltage drop on R11 is very small, and the voltage between the GS ends of Q7 is very small, Q7 is also cut off, so there is no voltage output. When BP17 is closed, R11, BP17, R21, and C69 form a loop, and the power supply charges C69. When the voltage of C69 rises to about 3V, Q8 is turned on, the D-level current on Q8 increases, the voltage drop on R11 increases, and Q7 is turned on. Since the impedance of Q7 after turning on is very small, the power supply is similar to being turned on, and C69 continues to charge until the power supply voltage is reached. When BP17 is pressed again, C69 discharges through the switch, and the voltage decreases. When it drops below 3V, Q8 is cut off, and Q7 is also cut off, and the switch is closed. In this system, before Q7 and Q8 are turned on, the impedance of the MOS tube is very large, so the power consumption current is very small. [page]

3.2 Charging Circuit Design

The charging circuit can provide great convenience for users. In general, the requirements that the charging circuit needs to meet are: it must ensure that the battery is not overcharged during charging; the charging time cannot be too short, but at the same time it must ensure that the charging current is not too large; there is a charging indication. According to the above requirements, the working principle of the circuit is: LM7812 is a voltage regulator module that provides a stable 9V voltage for the system. LM555 is a trigger, leg 2 and leg 6 are trigger terminals, leg 5 is the reference voltage, when the voltage of leg 2 is less than one-third of the voltage of leg 5 and leg 6 is less than leg 5, leg 3 outputs 0V; when the voltage of leg 2 is less than leg 5 but the voltage of leg 5 is greater than one-third of the voltage of leg 6, leg 3 outputs VCC; when the voltage of leg 2 is greater than leg 5, leg 3 outputs 0V. When the system is powered on but the rechargeable battery is not discharged, the above condition 1 is met, so the tube leg 3 outputs 0V and the diode is not lit; when the battery to be charged is connected to the VCC terminal, the collected voltage filtered by C45 (to prevent interference pulses) is transmitted to the tube legs 2 and 6. Because the battery itself has voltage, the above condition 2 is met at this time, and the tube leg 3 outputs 9V to start charging, and the light-emitting diode becomes brighter; when charging is completed and the battery reaches the specified voltage, the above condition 3 is met, the tube leg 3 outputs 0V, charging ends, and the light-emitting diode goes out. In summary, as long as the reference voltage is accurate enough, the battery will not be overcharged. At the same time, the charging voltage can reach 9V, so adjusting R52 can completely balance the charging current and charging time. Therefore, this circuit can meet the above requirements.

3.3 Basic process of PROTEL circuit design and circuit board wiring

Schematic diagram part: Establish your own component library. Because not all components exist in the PROTEL component library, you generally need to establish your own component library based on the chips you actually use. Draw a schematic diagram. When there are many devices, you can use a hierarchical design method. Design the system in modules, which can make the system clearer and reduce the possibility of errors. After the schematic diagram is drawn, use its automatic numbering function to number the devices. PCB board part. Establish your own package library. Like the component library, sometimes you must establish your own package library. When drawing the package, you must strictly follow the chip company's information. Set the package for each component. Use the wizard to generate the PCB file and define the number of layers and boundaries of the circuit board. Use the design synchronizer to import the device into the PCB. Design rules according to the specific process, such as via size and minimum line width. Layout and route the components according to the principle of easy routing. Follow some principles when routing. Check for errors.

4. System software design

4.1 LINUX transplantation on AT91RM9200

There are two boot modes for AT91RM9200: 1. There is a boot program in the part of its internal memory address 0x00100000-0x001FFFFF. If this boot mode is selected, the address of the part 0x00100000-0x001FFFFF is mapped to 0x00000000, and the CPU runs this program. This program will continuously send the character "C" to the CPU's debug serial port (or USB port), and provide a serial port (using XMODEM protocol) download function for programs less than 12K. 2. It can be directly booted from external memory, mainly SPI DataFlash connected to SPI (Serial External Device Interface) and NCS0 (a leg on the CPU, which is part of EBI, i.e., external bus interface, used for addressing external memory), Two-wire EEPROM and 8-bit parallel memory connected to NCS0.

According to the CPU startup method, we can design the migration process and the system startup method in this way. In the system migration stage, we apply startup method

1, and use its download function to download a program smaller than 12K (the actual program used is Loader, which is open source software and can be downloaded online) to SDRAM and run it. This program can provide a serial port download function larger than 12K. Use this program to download a larger program to SDRAM, and this program can provide functions similar to BIOS on a PC (the actual program used is U-BOOT, which is open source software and can be downloaded online). Its main functions include: LINUX system boot, network card driver, TFTP download function, and read and write functions between SDRAM and FLASH.

The kernel is downloaded to SDRAM through its TFTP download function, and the operating system is booted and tested. If the operating system test is correct, the U-BOOT write FLASH function can be used to write U-BOOT and the LINUX kernel to FLASH. In the application development phase, the CPU boot method 2 is used to boot directly from FLASH. The advantage of this method is that it provides a TFTP download function when downloading the kernel, which speeds up the process. In the application development phase, because the kernel (and the subsequent RAMDISK) are all solidified in FLASH, the download process can be omitted, which can also save time [3].

The transplantation process can be roughly divided into the following steps: 1. Configure the user environment and cross-compilation environment; 2. Compile Loader and UBoot, in which the network card driver must be modified in UBoot; 3. Configure the Linux kernel; 4. Make a ramdisk file system and modify it according to the actual system; 5. Transplant Busybox; 6. Transplant the JFFS2 file system. The Linux kernel already includes the drivers for the MTD and JFFS2 file systems, but the drivers must be written for the specific system. The specific steps are as follows: 1) Since the major device number (major) of the ROM device and the MTD lock device is 31, if you do not want to use JFFS2 as the root file system, you must modify the major of one of them. 2) Write the driver: Write the read, write, and copy interfaces (these interfaces will be called by the MTD driver and provided to the read, write, and copy functions of the upper-level software), define the map_info structure so that MTD can get the pointer of the read and write functions from this structure, and finally define the partition table of FLASH. According to the system design, we divide the 4M FLASH into four partitions. The first partition is used to store UBOOT and its parameters; the second partition is used to store the LINUX kernel; the third partition is used to store RAMDISK; and the last partition is used to store system parameters, user data, and test data. 3) Modify the LINUX configuration file and add the driver to the kernel [4]. [page]

4.2 Writing LINUX Drivers

We study the writing of drivers for character devices. The writing of block device drivers has certain similarities with the writing of character device drivers.

When the driver is loaded, the kernel will call the user-defined initialization program. The user uses init_module(function name) to identify the initialization program, where function name is the function name of the written initialization function. Use module_exit(function name) to identify the release of the device program. In the initialization function, the driver must register the device with the operating system to obtain system resources and the operating system to call the driver correctly. In Linux, this function is register_chrdev, and its definition in fs/devices.h is: int register_chrdev(unsigned int major,const char* name,struct file_operation *fops).

Among them, major is the major device number requested by the system for the device, name is the name defined by the driver for the device, and fops is a structure to be introduced next. When uninstalling, you need to inform the operating system to unregister [5].

The following is a brief introduction to several main and commonly used methods in the file_operation structure.

1. ssize_t (*read) (struct file *, char *, size_t, loff_t *); is used to read data from the device.

2. ssize_t (*write) (struct file *, const char *, size_t, loff_t *); sends data to the device.

3. int (*ioctl) (struct inode *,struct file *,unsigned int,unsigned long); The system call ioctl provides a way to execute device-specific commands (such as formatting a track on a floppy disk, which is neither a read operation nor a write operation).

4. int (*open) (struct inode *, struct file *); is always the first operation performed on a device file.

5. int (*release) (struct inode *, struct file *); This operation will be called when the file structure is released.

4.3 RFID Programming
The RFID chip used in this system is RC-S600 produced by SONY, which has its own communication protocol and supports direct connection via serial port or USB port. This greatly facilitates the development and application of the system. Since this system uses the standard serial port connection method, we must first provide a set of API interface functions for the serial port in accordance with the requirements of the application program.

1. int PortOpen(pportinfo_t pportinfo); Open the serial port and return the file descriptor. pportinfo: the serial port information to be set.

2. int PortSet(int fdcom, const pportinfo_t pportinfo); Set the serial port. fdcom: serial port file descriptor, pportinfo: serial port information to be set.

3. void PortClose(int fdcom); Close the serial port. fdcom: serial port file descriptor.

4. int PortSend(int fdcom, char *data, int datalen); send data. fdcom: serial port descriptor, data: data to be sent, datalen: data length. Return the actual sent length.

5. int PortRecv(int fdcom, char *data, int datalen, int baudrate); Receive data. fdcom: serial port descriptor, data: receiving buffer, datalen.: receiving length, baudrate: baud rate. Returns the actual length read.

After completing the basic functions of serial communication, you can control the RFID chip by sending command words from the serial port. The following is the command description of RC-S600: 1. Polling Command. The command to obtain the manufacturing ID (IDm) and manufacturing parameter (PMm) from the card with the specified System Code. 2. Diagnose R/W. The command for the RC-S600 series to perform self-diagnosis and obtain the diagnosis results. 3. Turn off RF Power. Set the RF output of the RC-S600 series to Off; 4. Check Firmware Version. Get the version number of the RC-S600 series Software; 5. Control LED. Turn on/off the LED connected to the RC-S600; 6. Communication Thru. Send a host-specified command to the card once, and return the Card Response Packet to the host based on whether the response is received from the card; 7. Access I/O Register. Perform initial settings for the RF of the RC-S600 series.

After testing, the system can correctly read, write and return the specified command words of the RFID chip used.

5. Conclusion

This paper presents a RFID system design based on ARM platform, which has passed the actual test. Since this system adopts standard interface design, it provides an ideal hardware environment for future multi-functional development platform.

References:

[1]. MT48LC2M32B2TG-6 datasheet http://www.dzsc.com/datasheet/MT48LC2M32B2TG-6_1054742.html.
[2]. RTL8201 datasheet http://www.dzsc.com/datasheet/RTL8201_586322.html.
[3]. AT91RM9200 datasheet http://www.dzsc.com/datasheet/AT91RM9200_[4]. 2N7000 datasheet http://www.dzsc.com/datasheet/2N7000_38377.html.
[5]. LM7812 datasheet http://www.dzsc.com/datasheet/LM7812_843716.html.
[6]. LM555 datasheet http://www.dzsc.com/datasheet/LM555_451680.html.
[7]. PCB datasheet http://www.dzsc.com/datasheet/PCB_1201640.html.
[8]. major datasheet http://www.dzsc.com/datasheet/major_2533383.html.

Reference address:Design and implementation of RFID system based on ARM platform

Previous article:RFID Information Collection and Processing System Based on Linux
Next article:Design and implementation of positioning function of embedded logistics information terminal

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号