Portable RFID Information Collection and Processing System Based on Embedded Linux

Source: Internet
Author: User

Portable RFID Information Collection and Processing System Based on Embedded Linux
[Date:] Source: Electronic Technology Application Author: Wu Guoqiang, Lu baiquan [Font:Large Medium Small]

 

Radio Frequency Identification (RFID) is a non-contact automatic identification technology. It uses RF signals to automatically identify the target object and obtain relevant data. It can work in various harsh environments without manual intervention. RFID technology has been applied in many fields, such as parking lot management and container transportation management systems. In most applications, as long as there is a fixed reader, but in some special systems (such as the Container Transportation Management System), not only requires a fixed reader, but also requires a hand-held card reader.
TagMaster AB is a world-renowned manufacturer of RFID card readers. It provides a fixed reader with excellent performance and a handheld reader. The handheld card reader consists of Caiso's industrial PDA (Personal Digital Assistants) and TagMaster AB's S1510. Although the PDA has powerful functions, it has the following Disadvantages: (1) the touch screen input method provided is too fine and not suitable for on-site operations by staff; (2) Poor Display Effect of tft LCD screen under strong light, it consumes a lot of power and cannot work at low temperatures (less than 0 ℃). Therefore, it is not suitable for outdoor work. (3) it is costly to use Microsoft's commercial system WinCE.
This article introduces a portable RFID Information Collection and Processing System Based on Embedded Linux. It uses a high-performance 32-bit ARM920T series microprocessor, 8-key keyboard and OLED display, combined with S1510 to achieve the collection, processing and real-time display of electronic label card information, the above problems are well solved.
1 system composition
System adoptionATMELThe AT91RM9200 32-bit high-performance processor, the S1510 of TagMaster, And the OLED display module provide functions such as collection, processing, real-time display, and communication with the host computer. System Composition 1.

1.1 Microprocessor
The system uses AT91 Series Microprocessor AT91RM9200 with ARM920T as the core. It features a clock speed of up to 180 MHz and advanced power-saving technology. It integrates interfaces such as SDRAM, Flash, infrared, and USB. The system uses USB (Universal Serial Bus) and infrared mode to communicate with the host computer. The infrared method is realized by HSDL-3602 infrared transceiver of Agilent.
1.2 Radio Frequency Identification Module
The RFID module uses the Swedish TagMaster AB GHz product S1510. This module is small and designed for handheld devices. It can collect data from various electronic tags within one meter. It communicates with the processor through the USART serial port. The interface is simple and easy to implement by hardware. To ensure reliable data transmission, the module communicates with the microprocessor using the responsive serial port communication protocol ConfiTalk developed by TagMaster AB.
ConfiTalk is a character-oriented series communication protocol. It transmits data blocks (frames) of a certain length each time, and each frame contains the frame header (STX) and the frame tail (ETX ). To improve the reliability of data transmission, each frame is added with 8-bit check bit (CS) and address bit (ADR ). Frame Structure 2.

MESSAGE indicates information of any length. The Protocol specifies that the frame sent by the microprocessor to S1510 is a command frame, and the returned frame is a response frame. The S1510 used in this system is the latest product of TagMaster AB. It supports data transmission based on the MAIL command of the ConfiTalk protocol. MAIL command communication means to unify the MESSAGE fields in frames into four formats. The command frames include MAIL_SEND and MAIL_RECEIVE, s1510 receives user information and returns card information (including card number, card status, and card storage data.
There are two types of response frames: The MAIL_SEND response frame and the MAIL_RECEIVE response frame, 4.

 

In Figure 4, 36 indicates that S1510 processes command frames and response frames in MAIL mode, while 4 and 5 indicate the type of S1510 command frames (MAIL_SEND or MAIL_RECEIVE ); status indicates the execution Status of the command (successful or failed). The Data field in the MAIL_SEND command frame indicates the operation and parameters to be performed by the user, such as making Data = WRITE: parameter: Data, that is, the user needs to write Data to the electronic tag card. The Data field in the MAIL_RECEIVE response frame is the Data requested by the user.
When using the MAIL command to read and write the label card, you only need to fill the fields in the frame format, and then use the API functions provided by the ConfiTalk protocol to send to S1510. The command is clear and clear, which greatly facilitates user development.
1.3 OLED display module
The system uses the OLED display module rgs24128064yw001. Organic Light Emitting Display is hailed as a "fantastic display ". Compared with the LCD screen, the OLED display screen is lighter and thinner with a larger visual angle, which can significantly save energy and work normally at a low temperature of-40 ℃. Rgs24128064yw001 has a serial and 8-bit parallel data interface. The system uses 8-bit Parallel interfaces to communicate with the microprocessor.
1.4 SDRAM, Flash, and custom keyboard
The system uses 32-bit synchronous dynamic random memory (SDRAM) as the system memory, and 16-bit flash as the non-loss data storage. Users can perform various operations through an 8-key keyboard, such as reading cards and writing cards.
2 System Software Design
System software is the soul of the entire system. Its design directly affects system stability, scalability, and other performance. The system design divides the software into two layers, as shown in Figure 5. The bottom layer is the operating system layer, which is mainly used to transplant the Linux operating system and write various device drivers, including the device drivers such as the OLED module, USB device, infrared, and keyboard. The last layer is the application layer, which provides functions such as card information display, keyboard scanning, electronic tag card reading and writing, file transmission, clock, and battery power detection.

2.1 embedded Linux
Linux is a multi-task operating system with open source code. It is highly open, secure, stable, and portable. It is widely used in embedded operating systems.
The Linux Kernel used in this design is based on ARM-Linux, and the device drivers of the OLED display module, USB device, infrared transceiver, and keyboard are compiled. In Linux, the device driver plays an important role. It provides interfaces for operating hardware in user space. In Linux, devices are divided into character devices, Block devices, and network devices. Data Structures and registration functions for different devices are provided. When you develop a device driver, you only need to fill in the device data structure by hardware operations and register it to the kernel.
To facilitate the compilation of user applications, the USB device is implemented as a CDC (communication device class) device. The driver is divided into two layers, and the underlying operation is the USB device controller on at91rm9200, for example, hardware interruption, read/write registers, and operation I/O ports are used to detect device plugging. The upper layer realizes the connection between the underlying layer and the TCP/IP protocol layer, which is mainly used to simulate physical NICs, and register it with the kernel. In this way, the USB device in the application is a standard network device. You do not need to know the driver interface, but directly use the socket provided by Linux for network communication program development. During secondary development, you can directly transplant the network communication program developed by the upper computer to the system without modification, in addition, the embedded system can be operated through tools such as telnet on the host computer.
Other drivers (such as the OLED display module, keyboard, and infrared transceiver) are written as standard character devices in Linux and registered using the register_chrdev () function, provides read, write, and control operations. In Linux, applications perform the same operations on character devices and files.
In Linux, device drivers can be dynamically loaded and uninstalled through modules, or compiled directly into the kernel. The former is flexible and can reduce the kernel, but because the embedded system requires that all devices are ready after initialization, the driver module of the device cannot be loaded during use. Therefore, all the device drivers in the system are directly compiled into the kernel.
Each device driver corresponds to a device file in the user space, which is managed by the file system. The system uses ext2 as the root file system. To facilitate development and upgrade, the root file system is first made into the ramdisk format. The so-called ramdisk is to decompress the compressed file to the memory after the system is started to form a virtual hard disk. Then, write the boot program, kernel image, and root file system to flash.
After the system is powered on, the boot program transfers the kernel image from flash to the memory, and then starts execution from the core entry: First initializes the CPU, then loads the driver of each device, and finally mounts the file system, run the application.
2.2 Application Design
Linux is a multitasking system that supports multiple threads and processes. The advantage of Multithreading is that threads are smaller than processes, so that applications can be lighter and inter-thread communication is convenient. The disadvantage is that all threads use the same address space. If a thread has problems, the entire system will be affected, and each process occupies a memory space, which can enhance the system stability. However, multi-process increases the system overhead and complicated inter-process communication. Therefore, considering the system stability, the system combines the two methods to complete data collection and processing and file transmission functions.
2.2.1 data collection and processing
Data collection and processing is a process that includes the main thread and auxiliary thread. The main thread reads, writes, and displays and queries the information of the electronic tag card in real time. The secondary thread implements a clock to provide the user's current time, and regularly checks and dynamically displays the battery power, A warning is issued when the power usage is too low.
The application uses the MAIL command to read and write the electronic tag card. The process first initializes the screen, and then waits for the key to be interrupted. When a key is pressed, the corresponding work is executed based on the key value. When no key is pressed within the specified time, the system enters the sleep state, to achieve power saving. Program flowchart 6.

After the tag card information is collected, the application provides the card information (including the card number, card status, user data, and current time) to the user through the OLED display screen, and writes a file for recording. Because the file transfer process transfers the file to the host computer, you must lock the file when reading and writing the file. Linux provides a file lock to prevent different processes from simultaneously accessing the same file. This article uses the flock () function to lock and unlock files.
Because the OLED is a Graphic Lattice display screen and the Flash capacity is limited, it is impossible to directly use the Chinese Character Font. The system extracts all the dot matrix data of Chinese characters, numbers, and letters used in advance, and then creates its own font file so that the application can display Chinese characters, numbers, and letters.
2.2.2 File Transfer
File transmission is a process that uploads card information and downloads other data. The Clinet/Server model is used to communicate with the host computer. This process is essentially a server-side (Local System) application, which cyclically waits for connection requests from the client (host computer. When the request arrives, first determine the interface from which the request comes (USB or infrared interface), and then perform the corresponding upload or download based on the request type. Considering that multiple handheld readers may be used in practical applications, in order to facilitate information management by the upper computer, the file name should be composed of the serial number of the handheld reader and the serial number of the file to be uploaded, when a Program uploads a file, it automatically adds its ID and upload sequence number to the file name. Process 7.

3 system power management
This system uses lithium batteries to power the system. To prolong the battery life, the application is designed to run in three states: idle power-on, program execution, and system sleep. If you do not perform any operation, the system goes to sleep state to save power. The system's sleep is implemented based on the microprocessor's power management function. The steps for going to sleep are as follows:
(1) Disable all peripherals;
(2) Save the current system status;
(3) Enable the SDRAM to enter the auto-Refresh mode;
(4) set a wake-up event to enable the microprocessor to sleep.
When a wake-up event occurs, if a key is pressed, the system is reset. The process is as follows:
(1) recover some microprocessor registers;
(2) Wake up external devices and the system starts to run.
This article introduces how to run embedded Linux on the high-performance ARM chip AT91RM9200. Combined with the powerful RFID module S1510 of TagMaster AB, the system can collect and process information of the portable tag card. The system is easy to use and flexible. In addition, to overcome the disadvantages of Low Temperature LCD, low brightness and high power consumption, the OLED display module enables the system to be applied in harsh environments and increases the battery endurance; to facilitate the communication between the system and the host computer, a USB Interface Supporting hot swapping is used.
References
1 Rubini, translated by Wei Yongming. LINUX Device Driver (version 2) [M]. Beijing: China Power Press, 2002
2 Zhang Juan, Wu Dawei. Research on RFID-Based Portable Data Collection and processing systems [J]. Micro-computer applications, 2005; 21 (6)
3 Cai Zhen, Jiang huibai, Zhou Lihua. Development of USB driver in Linux system [J]. Computer Measurement and Control, 2003; 11 (2)
4 TagMaster AB. Sweden. Handheld Confi Talk Reference Manual [Z]. 2003
5 TagMaster AB. Programmer's Guide LockTag Handheld [Z]. 2005
6 Robert love. Linux kernel development (second edition) [M]. Beijing: Machinery Industry Press, 2005

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.