Design of GPS Smart terminal based on embedded ARM-Linux

Source: Internet
Author: User
Design of GPS Smart terminal based on embedded ARM-Linux

GPS Smart terminal is an important part of Intelligent Transportation System (ITS System). It integrates satellite positioning technology (GPS), geographic information system (GIS) and wireless communication technology. Currently, satellite positioning terminals are generally composed of 8-bit/16-bit single-chip microcomputer, GSM/GPRS communication module, GPS module, and LCD display, the split structure of the liquid crystal part and the main control chipset is separated in two casings. This article introduces and designs an embedded smart terminal based on arm920 processor and embedded Linux operating system that combines GPS technology with CDMA network. The terminal connects the dynamic location, time, status, and other information of the GPS terminal to the control center through the CDMA wireless network in real time and displays the information on an electronic map with the geographic information processing and query functions, monitors and queries basic information such as the accurate location, speed, movement direction, and terminal status of the terminal, generates alarms (including active and automatic alarms), and displays scheduling information; external Device data collection, local temperature collection, remote monitoring, and other functions.

1. Overall Design Scheme of GPS Intelligent Monitoring System
The communication between the GPS Smart terminal and the monitoring center is an important factor affecting the functions of the entire its system. To solve the problem that the terminal currently uses GSM and GPRS networks for insufficient data transmission, the CDMA 1X network is used in the design. The theoretical transmission rate can reach 300 kb/s, and the data transmission rate is high and always online, based on the IP protocol, you can access the entire Internet. It is billed by traffic and the price is reasonable. It has good scalability and covers most indoor areas and sea areas within 120 km from the coastline. there is basically no blind zone. The communication speed is much higher than that of the GPRS network. It is more suitable for monitoring large data volumes and real-time transmission, and is easy to smoothly transition to 3G mobile communication systems. The GPS intelligent monitoring system consists of GPS smart terminals, CDMA networks, Internet networks, and monitoring centers, as shown in figure 1.

2 hardware design of GPS smart terminals
2.1 platform Introduction
Mobile Terminals designed with arm processors and embedded technology are significantly improved in terms of both functions and man-machine interfaces compared with terminals that use 8-bit/16-bit single-chip microcomputer as the central processor, is an important development of microprocessor technology. The at91rm9200 processor of ATMEL is used as the main controller. This kernel is an ARM chip dedicated for industrial control, with a wide operating temperature and other good industrial parameters. It also integrates a wide range of System Application peripherals and standard interfaces; up to 180 MIPS processing speed at 200 MHz clock speed; External Bus Interface Ebi .; Two USB 2.0 host ports and one USB 2. O device port; One 10/100 Mbit/s Ethernet communication interface; Four Synchronous/asynchronous serial ports; multiple serial data channels; Support for I2C and I2S. Its wide range of external devices and data transmission features are the main reason for choosing it as the master controller.
2.2 Hardware Design
The hardware system of the GPS Smart terminal is shown in figure 2.

2.2.1 arm master module
The serial ports uart2 and uart3 of at91rm9200 communicate with the CDMA and GPS modules respectively. During actual communication, the two connections are connected with conversion circuits from lvttl level to RS 232 level. The at91rm9200 receives the location information sent by the GPS module from the serial port 3, parses the useful data for encapsulation, and then delivers it to the CDMA module through the serial port 2 in the specified format, access the Internet through the CDMA network and finally send it to its monitoring center. Receive and parse Short Message commands sent from its control center, and upload and locate operations by command; display the system running status and information sent from its control center on the LCD screen.
2.2.2 CDMA Communication Module
The CDMA module is the basis for the communication of the entire system. It is designed to use the fd810 CDMA communication module of fidelix. The Qualcomm msm6025 chip is embedded in this module. In addition to basic calls and SMS short messages, it also supports wireless data transmission of CDMA 20001x. High-speed upstream/downstream speed and large cache, data transmission rate up to 153.6 kb/s, you can use the AT command to remotely control the built-in TCP/IP protocol stack. DTGS-800 and at91rm9200 realize data sending and receiving and AT command operation through serial port uart2.
2.2.3 GPS module
The GPS receiving module selects the itrax100 from fastrax. This module supports the data formats of nmea0183 and Sony ASC ⅱ protocols. The GPS module sends data to at91rm9200 in a fixed frame format through serial port 3. The GPS module must be equipped with a dedicated GPS antenna to receive GPS satellite signals. Generally, in a relatively wide area, more than three GPS satellite signals must be received for accurate positioning.
2.2.4 Storage System
The memory system uses 4 MB nor flash, 64 mb nand Flash, and 32 mb sdram. Nor flash exchanges data with the CPU through a 16-Bit Data Bus to store uboot, Linux kernel, and file systems. NAND Flash stores applications as system data storage, such as loading electronic charts. To make full use of the data processing capabilities of the 32-bit ARM processor, two 16-bit hy57v281620hg parallel links are selected to build 32-bit SDRAM and arm to exchange data. SDRAM is mainly used as the runtime space, data, and stack area of the program in the system.
First, the uboot, Linux kernel, and file system are burned to nor flash through the JTAG port, and the application program is burned to nandflash. When the system starts, the CPU first reads the startup code from the reset address 0x0, and configures the norflash memory containing the boot program uboot to: bank0, that is, the ncs0 pin of at91rm9200 is connected to the CE end of nor flash chip at49bv322ad, so that the embedded Linux operating system can be started from nor flash.

3. Software Design for GPS smart terminals
Embedded Linux only requires three basic elements: boot program, Linux microkernel, and initialization process. porting embedded Linux is to enable real-time nuclear energy in other processors (CPUs) or microcontroller (MCU). Porting embedded Linux to the at91rm9200 platform usually requires four steps: Download the source code and build a cross-compiling environment, configure the compiling kernel, create a file system, download and debug the kernel.
3.1 Application Design
Applications include uboot startup code, serial device drivers, CDMA network data transmission programs, and GPS serial communication programs.
(1) reset after power-on;
(2) uboot initializes CPU, sdrma, and allocates address space;
(3) uboot decompress the compressed Linux Kernel File to SDRAM, and uboot transfers control to Linux.
Linux Kernel runs in flash memory directly and loads it into memory. The flash memory running method is relatively complicated, but the running speed is faster;
(4) run the code in sdrma, initialize the Linux kernel, and allocate stacks and interrupts;
(5) load the serial port driver module to complete serial port initialization;
(6) run the CDMA network data transmission program and connect to the Internet through the CDMA network;
(7) run the GPS serial port communication program and send the GPS data to at91rm9200 through the serial port.
So far, a complete embedded monitoring system has been established from GPS data collection to data transmission.
3.2 Wireless Access Network Program
After a terminal is connected to the Internet through a CDMA network, data is transmitted over the Internet. After the system powers on and loads Linux, first initialize the CDMA module, set the port and baud rate (115 200 B/S), and then enter the dialing wait state. Because the terminal is mapped to a wireless modem, a PPP dial-up connection is required to log on to the network. The access number is #777, and the user name and password are both card. After the program is started, check whether the dial is successful. If the dial is successful, call the GPS serial communication program and Network Data Transmission program. After the Internet is used, close the wireless connection.
3.3 CDMA network data transmission program
In Linux, the monitoring terminal connects to the Internet through a CDMA network and uploads data to the monitoring center. Socket socket is a common API for network programming in many operating systems. It is a programming interface between the network application layer and the transmission layer. Sockets provide a large number of system calls and corresponding data structures to access the lower-layer communication protocols. The network communication process of processes on Linux is the process of data transmission using sockets ., The socket communication described in this article adopts connection-oriented TCP protocol.
The TCP application process on the client and server is shown in step 3. In the client, socket () is used to create a local interface and assign a value to the address structure of the server end interface. The CONNECT () function is used to send a connection request to the server end interface, three handshakes are used to establish a TCP connection. If the connection is established successfully, send () and Recv () functions are used to communicate with the server. After the communication ends, close () is used to close the set of interfaces.
The server creates a set of interfaces by socket () and assigns values to the address structure of the set interfaces. Call the BIND () function to bind the set interface and use the listen () function to listen to requests on the set interface; when the accept () function accepts the request, a new set of interfaces and descriptions are generated and connected to the client. When a new sub-process derived from the fork () function is used to communicate with the client, the main process continues to process other requests.
3.4 GPS serial communication program
The GPS serial communication program parses the collected GPS data and vehicle status data, and parses time, longitude, latitude, speed, and overspeed alarms, and transmitted to at91rm9200 through serial port 3 in a fixed format. The workflow of the GPS module is shown in step 4.

GPS receives data in the nmea0183 format. The serial communication parameters are 8-bit data bits, with no parity check and 1-bit Stop bits without data flow control. The baud rate is set to 115 200 B/S. Determines whether the frame starts with $ G-PGGA. If yes, reads GPS data by bit,

In Linux, all hardware devices are considered as common files. You can enable, disable, read, and write devices by calling the same standard system as normal files. Each device in the system is represented by a special device-related file, which is stored in the/dev directory. In Linux, the description of each device is uniquely determined by the master device number and sub-device number. All devices driven by the same device have the same master device number. The master device number describes the drivers that control the device ~ 255); device number is used to distinguish different devices controlled by the same driver.

4. labs and results
The client program running the Embedded Target Board collects and sends GPS data, and runs the server on the host computer to receive GPS data. 5. Compare the GPS data received by the monitoring center server with the GPS data collected by the terminal, it implements wireless and real-time data transmission between terminals and monitoring centers. The terminal runs stably and the system response time is less than or equal to 3 s. When the network is good, the data transmission rate reaches 115 B/S.

5 knots
Using the system functions provided by the embedded Linux operating system development platform, you can simplify multi-task programming, reduce development difficulty, and easily complete tasks that are difficult to complete in front and back-end programming methods. Because CDMA data transmission is always online, cost-effective, and can be switched to the SMS mode, ensuring data transmission is foolproof, and with the development of mobile communication networks, the GPS Smart terminal makes it easier to smoothly transition to the 3G mobile communication system. Therefore, there will be more broad application prospects.

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.