The abstract elaboration in WiTadows in the CE embedded system, realizes GPS and the PDA correspondence method using the serial port. First, introduced that the GPS signal the data format, and carries on the description to system’s software and hardware environment and the serial communication. Finally, designs the GPS signal processing module, explained in detail how to use the embedded program language development serial port signal procedure, and gives the concrete step and the part realizes the code.
Key word GPS the PDA serial port corresponds Windows CE
Introduction
3PS is the global positioning system, mainly has three big constituent - - space constellation part, the ground monitoring part and the subscriber’s equipment part. And (the GPS space constellation part, the ground monitoring part is the US controls; (The GPS subscriber’s equipment is mainly composed of the receiver hardware and the processing software. The user receives the GPS satellite signal through the subscriber’s equipment, obtains information and so on user position, speed after the signal processing, realizes finally using GPS carries on the guidance and the localization goal. At present, many GPS manufacturers follow the NMEAO183 agreement the computer to develop many guidance GPS in view of the PDA palm on.
GPS realizes the data communication through the serial port and PDA, the data which the use (3PS transmits, may obtain parameters and so on object real-time position, speed on PDA. Through with the GIS system’s integration, may realize the digital navigation on PDA, on the map understood very intuitively locates information and so on position. Below explained specifically how to realize GPS and the PDA serial port correspondence.
1 serial communication
Each Pocket PC has a serial port, so that PocketPC can carry on the correspondence with the exterior serial device between. Serial port’s essential function is takes between the chip and serial device’s code switch. When the data passes through from the chip the serial port transmits, the byte data is transformed into the serial position. When receives the data, the serial position will be transformed into the byte data. Windows CE has used correspondence driver Comm.drv, with the aim of using the standard Windows the API function transmission and the receive data. The driver usually provides by the serial port equipment manufacturer, in order to hardware and Windows CE connection. In the programming, has simulated a COM6 serial port. Uses Comm6.PoxtOpen to open the serial port first, establishes Comm to control a attribute, Timer triggers OnComm to receive the GPS signal the event, realizes the GPS signal real-time receive. GPS provides the serial communication connection, the serial communication parameter is: Baudrate =57 600 bps, the data position =8 position, starts the position =1 position, stops the position =1 position, non-parity check.
2 GPS data format
The NMEA0183 agreement is the GPS connection protocol standard which the American Country Sea Electron Association (NationaIMarine Electronlcs Association) formulates. NMEA0183 has defined certain representatives the different meaning sentence, each sentence in fact is a ASCII code string. This kind of code is direct-viewing, easy to distinguish and the application. In the experiment, does not need to understand that the NMEA0183 communication protocol the complete information, only needs to choose that part of locator data which needs, other information neglect.
On when GPS and the palm the computer corresponds, transmits 10 data through serial port each second. When the actual guidance application reads GPS the space orientation data, every other may according to need several seconds renew a time latitude and longitude and when to ask the data, does not need frequently the refresh data, otherwise, will waste on the palm the equipment limited electrical energy. If is normal with the satellite communication, may receive the data format is as follows: $GPGGA,<l>,<2>,<3>,<4>,<5>,<6>,<7>,<8>,<9>,<10>,<u>,<12>*hh<cR><LF>. Its concrete information like table l arranges in order.

A complete NEMA0183 sentence is from the outset symbol “$GPGGA” until the termination symbol “<CR><LF>” section of strings of character. Needs to grasp the information is the latitude and longitude, the latitude and longitude direction, the GPS localization condition and the received signal time. When therefore receives this kind of complete NEMA0183 sentence, the extraction useful information’s method is: Determines outset symbol $GPGGA the first position, starts from the outset symbol to read the person data, then seeks for the character after different or in the verification sentence “,”, then around the interception two “,” between character (string) obtains the data which cared, and by carriage return Fu Wei a CPS sentence’s termination symbol, obtains a complete GPS signal. In withdraws in the GPS sentence, pursues the comma position which the latitude and longitude is, the read-out latitude and longitude coordinate, carries on again the latitude and longitude coordinate the number of degree the transformation. Because map’s coordinate is take the number of degree as the standard.
3 GPS signal processing
According to serial communication’s principle, unifies the GPS data the form, may design the GPS signal processing module to withdraw and (the 3PS position related information. Because the common user coordinate system is the charting coordinate system, therefore must withdraw from the GPS signal coordinate by WGS84 coordinate transformation for corresponding 54, 80 coordinates or place coordinate.
3.1 GPS signal processing module design
GPS data processing module’s design proposal like chart l shows. The GPS receiver 6 the locator data (NMEA 0183 Ver2.O) will pass to Pocket PC through the serial port, and locates the GPS data on the electronic map. In EVB, will control with the aid of Comm the locator data to read, will then carry on the locator data the classification, and will withdraw the information which will need, simultaneously will pass to these useful information the main application procedure. The main application procedure reorganizes again the GPS receiver’s control information NEMA0183 the VER2.O sentence, controls a transmission through Comm to deliver the GPS receiver concurrently. Thus, P0cket. PC and the GPS receiver’s serial port correspondence and the GPS locator data processing function through the advancement outside ActiveX server seal, the systematic real-time performance will realize through operating system’s advancement supervisor. Thus bypassed the EVB single thread insufficiency.

3.2 GPS signal receive and treating processes
After the GPS receive arriving sets at the signal, the system will carry on to the GPS localization information decomposes and withdraws the useful data. GPS signal receive and processing process: 6 obtain through the serial port the GPS output’s data transfer for the PDA, PDA master routine the goal current position (latitude and longitude coordinate, elevation), obtains the GPS data the receiver to carry on the decomposition, obtains the goal current position and the Greenwich Mean Time (this time adds on 8 hours namely for our country standard time), undergoes the corresponding coordinate transformation, again current position demonstration on electronic map. The GPS signal receive and processing as shown in Figure 2.

3.3 GPS signal’s receive procedure realizes
The system uses in Embedded Visual Basic the Comm correspondence to control and the Timer timer. The timer establishes to every other 2 s renew 1 time latitude and longitude and the time data. Each Comm controls to provide a communication port, realizes the data transmission.
Starts the real-time receive.
Prlvate Sub mnustart()
Timerl.lrlteIval=2000
Timerl.Enabled=True
Comml.CommPort=6
Comml.Settings= ” 57600, N,8.1 “
Comml.PortOpen=True
strsmsdata=Comml.Input ‘ in elimination serial port Buffer temporarily stored information
Timerl_Timer
End Sub
Private Sub TimerLTimer()
Dim IngNextvbCrLf As Long ‘ records the next carriage return to line feed the symbol position
Dim IngFirstGPGGA As Long
Dim Message As String
Dim sDate As String
Dim cn
strsmsdata=Comml.Input
IngFirstGPGGA=Instr (1, strsmsclata, ” $GPGGA “)
If lngFirstGPGGA Then
IngNextVbCrLf=lnstr (IngFirstGPGGA 1,
strsmsdata, vbCrLf)
Message=Mid (Strsmsdata, ingFirstGPGGA, lngNextvb
CrLf-ingFirstGPGGA)
ParseNMEAMessage Message, dblXCoord, dblYCoord, sDate
ProcessInput dblXCoord, dblYCoord
End Tf
4 GPS coordinate transformation
The GPS localization obtains the result belongs to the WGS84 coordinate, but in the project practical mostly is the national coordinate system, or is the independent coordinate system. The independent coordinate system is generally forms in the national coordinate system foundation, therefore, in the GPS localization result’s use has with the national coordinate system’s coordinate transformation question. Generally must through two steps the transformation: First (L, B) transforms the WGS84 geodetic coordinates to correspond to WGS84 the ellipsoid Gauss place coordinates (X84, Y84), then transforms again after the place coordinates, Gauss place coordinates (X84, Y84) constrained annexation local Gauss place coordinates system.
4.1 Gauss converts
The geodetic coordinates which obtains the GPS localization (L, B) transforms into the Gauss place coordinates (X84, Y84). The related inferential reasoning process is complex, this article only gives the result:

In the formula, ι= (L-L.)/p, ιo to throw the shadow band central meridian longitude, ρ=206 265s/rad; The tenth Earthly Branch circle radius of curvature
ellipsoid first eccentricity e=2α-α2; Subsidiary variable t=tgB; Subsidiary variable η=e ‘ cosB; The ellipse second eccentricity
respectively be reference ellipse length radius); Flatness α= (a-b) /a; X for the equator to the latitude is the B parallel meridian arc length, its formula is
![]()
4.2 place coordinates transformation
The place coordinates transform the goal is the Gauss place coordinates (X84, Y84) transforms into under the local country coordinate system or the independent coordinate system’s Gauss place coordinates. This article has designed one average revolution axis similar conversion technique. Take transforms as the Beijing 54 coordinate systems in (X54, Y54) is an example, explained that this method realizes the process.
First, according to the common point separately in the WGS84 coordinate system and Beijing 54 coordinate system’s Gauss place coordinates, extracts the common point in two coordinate systems the identical side difference of azimuth △a and length scale-up factor k. Then, calculates any spot in Beijing 54 coordinate systems coordinate according to the equation below.

In the formula: xo, yo respectively is the common point in Beijing 54 areal coordinates; x ‘, y ‘ o, respectively is the common point in WGS84 the areal coordinates; k is identical side in Beijing 54 with the WGS84 in ratio of length of side, when has above two public side, extracts separately, averaging value; △Aa for identical nearby in Beijing 54 with the WGS84 in difference of azimuth, △a=a54yia84, when has two above common points, extracts separately, averaging value.
4.3 spanning space exchange form vector data
The open country gathers the investigation object with GPS-PDA the geometry data and the attribute data. This data is one from the definition form, after processing, the locator data and the attribute data fusion production will conform to the request space vector data standard exchange form. This kind of standard format’s vector data document is composed of 6 parts: Article article, essential factor type parameter, attribute data structure, geometric figure data remark and attribute data.
5 application examples
Selection association phecda XP208 PDA and NAVMAN GPS1010 CF the casette GPS receiving apparatus, records the GPS localization information and the attribute data with the independent development’s data acquisition system.
The starting movement master routine, enters the main contact surface, after the code establishment and the parameter establishment complete, enters the survey contact surface. First, the choice measurement pattern, uses generally regarding the anomalous terrain feature “surveys the pattern continuously”, regular terrain feature use “interrupted survey” pattern. Then, the click survey key, starts to survey and the data recording. Default hour of observation 10 s, the system bell prompt, pressed suspends the key finishing this spot observation data record. This time, demonstrated on the PDA screen obtains the 1st spot. Meanwhile in moves in the station process, the GPS receiver continues maintains the track satellite, testing lights in next, presses surveys the key to continue the record, pressed suspends the key finishing this spot observation data record. Obtains in turn in addition the spot and demonstrated. If this time input attribute, then after click input attribute key. With “the pen” in this chart spot center point spot, springs the dialog box willfully. After choice terrain feature essential factor, springs the chart spot automatically the attribute input contact surface. On the spot measurement result as shown in Figure 3.

Conclusion
Through this design method, may receive completely the GPS localization guidance information from the GPS receiver, after passing through the coordinate transformation, saves for the space vector exchange form; After the processing spatial data may for other application system, like each kind of GIS, RS, ITS (Intelligent Transportatl011 System) and so on uses, realize in the vehicle carries aspect and so on guidance, intelligent transportation, open country exploration, traveling applications. This article narrated the example is realizes on the wired serial port. In the practical application process, may select other connection method to realize GPS and the PDA interconnection, for instance infrared connection, blue tooth technology and so on. Through revises suitably, may apply in which conveniently.