Detailed Analysis of Receiving and Decoding of GPS Data Signal Based on ARM Processor

GPS, the global positioning system, was developed by the United States in the 1970s. It lasted for 20 years and cost 20 billion US dollars. It was fully built in 1994 and has the capability of real-time 3D navigation and positioning in sea, land and air. In recent years, with the continuous improvement of GPS, the continuous improvement of hardware and software, the application field is constantly expanding. Now it has spread to various sectors of the national economy and has begun to gradually deepen people's daily lives. How to design a mobile device with GPS function to realize the reception and decoding of GPS satellite data has become a hot spot in CPS applications.

1 development platform

1.1 Software Platform

In order to adapt to the usage habits of most Windows users, we set the mobile device operating environment to the embedded operating system Windows CE 5.0 (WinCE 5.0 for short), and the development process is carried out under the Windows XP operating system. The development software is Visual Studio 2005 (referred to as VS2005), and the programming language is C++. VS2005 is a complete development tool for Windows applications for generating ASP web applications, XML Web services, desktop applications, and mobile applications. By using these tools and. NETFramework Lite (a subset of the .NET Framework) that can be created, generated, debugged, and deployed in personal digital assistants (PDAs), mobile phones, and other resource-constrained devices. An application running on the .NET Compact Framework.

1.2 Hardware Platform

1.2.1 Embedded Development Board

Since the operating environment used by the mobile device is set to WINCE 5.0, a large amount of data needs to be processed in the process, so the development board is required to be high. At present, the processors supported by WinCE 5.0 mainly include ARM, X86, PowerPC, MIPS, etc. Among them, ARM is a very powerful microprocessor architecture in embedded systems in recent years. At the same processor frequency, ARM core With the smallest chip area, lowest power consumption, and lowest price, it has advantages in performance, technical specifications, software support tools, built-in debugging tools, and development materials. Taking into account the size, power consumption, cost and other factors of the mobile terminal of the system, the processor of the ARM core was finally selected. The development board is the GEC2440 of the optical embedded company. The main parameters are shown in Table 1.

Design of GPS mobile device based on Windows CE platform

1.2.2 GPS receiving module

The GPS receiving module is responsible for receiving the GPS RF signal, down-converting and demodulating the signal, and outputting a standard serial port signal for the processor to perform the next processing. The GPS receiving module used in this design is the GPS-R36-AT module of Levave, and the performance parameters are shown in Table 2. The receiving module mainly comprises a baseband chip and a radio frequency chip, adopts a SIRF III module, integrates a chip ceramic chip, receives an antenna signal of a C/A code without an external antenna, and outputs a signal of NMEA0183 protocol data, and communicates with the main device through a serial port. .

Design of GPS mobile device based on Windows CE platform

2 overall design

The design is mainly based on the flow direction of the GPS data signal. The GPS data signal is read into the main program of the development board through the serial port, and then the data is decoded to obtain the latitude and longitude information of the current location, and then the location name of the current location is obtained by querying the latitude and longitude database, and the whole process is displayed by the touch screen and completed by the touch screen. Human-computer interaction.

2.1 serial port driver

Microsoft eMbedded Tools encapsulates Windows API functions for the development of Windows CE applications. In Windows CE, all devices are treated as files. Serial communication can be implemented by API communication functions like accessing ordinary files. The system's virtual driver is responsible for performing specific tasks. The serial port under Windows CE is considered to be a conventional installable stream device for opening, closing, reading and writing serial ports, a regular I/O driver call for serial device interfaces, and a specific function related to communication. Combine. Windows CE communication functions are similar to most other Windows communication functions. It is worth noting that Windows CE does not support direct programming of serial port registers.

2.1.1 Opening and Closing the Serial Port

The CreateFile function is used to open the serial port. m_hDSComm=CreateFile(_T("COM2:")), GENER2IC_READ|GENER IC_WR ITE, 0, NULL, OPEN_EXISTIN-G, 0, NULL). Note that there must be a colon after COM2. The third parameter dwShareMode must also be O, and the communication port cannot be shared like a file. The last parameter dwFlagsAnd-Attributes must be 0 because Windows CE only supports non-overlapping I/O. The return value of this function is the handle of the opened serial port or INVALLD_HANDLE_VALUE. Close the serial port to call CloseHandle(m_hDSComm).

2.1.2 Serial Port Parameter Settings

The serial port setting is mainly to configure the port settings with DCB configuration, including baud rate, stop bit, data bit length, check digit, flow control and timeout value. First open the serial port, use the GetCommState function to get the currently open serial port configuration, then modify the DCB members as needed, and finally set the new serial port configuration with the SetCommState function.

2.1.3 Setting Buffer Size and Timeout

For the serial port, the timeout value must be set, otherwise the program may fall into a loop to wait for characters from the serial port. This will greatly reduce the battery life of the device for Windows CE devices, so the timeout value must be configured. Another solution is to use multithreading. Usually, configuring the timeout value is similar to configuring a serial port. First use the GetCommTI-meouts function to get the timeout value of the current serial port, then modify the COM2MTIMEOUTS member, and finally set the timeout value with the SetCommTImeouts function.

2.1.4 Reading and writing serial port

48v20Ah Lithium Ion Battery

48V20Ah Lithium Ion Battery,48V 20Ah Lithium Iron Electric Bicycle Battery,48V20Ah Electrict Scooter Battery,Lifepo4 Lithium Battery 48V20A

Jiangsu Zhitai New Energy Technology Co.,Ltd , https://www.jszhitaienergy.com