0% found this document useful (0 votes)
48 views2 pages

GPS: Data Variables

The document describes GPS data variables and the logic used to parse GPS data received via interrupt, including latitude, longitude, time, speed and other variables, with the logic checking for start and separator characters to extract the values and store them in the appropriate variables. It also provides an example of the header format for a GPS data string with explanations of the fields.

Uploaded by

iamneoda
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views2 pages

GPS: Data Variables

The document describes GPS data variables and the logic used to parse GPS data received via interrupt, including latitude, longitude, time, speed and other variables, with the logic checking for start and separator characters to extract the values and store them in the appropriate variables. It also provides an example of the header format for a GPS data string with explanations of the fields.

Uploaded by

iamneoda
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

GPS:

Data Variables

Latitude gpsCurrentLatValue, tempGpsLatValue[7].


Latitude Direction gpsCurrentLatDirValue, tempGpsLatDirValue[1].
Longitude gpsCurrentLonValue, tempGpsLonValue[8].
Longitude Direction gpsCurrentLonDirValue, tempGpsLonDirValue[1].
UTC (time) gpsCurrentUtcValue, tempGpsUtcValue[6].
Speed gpsCurrentSpeed, tempGpsSpeedValue[5].

Position=latitude+longitude.

Function : gpsInit(); ---- Stores the values in all ‘Current’ variables .

Variables used for implementing the Logic:

1. gpsHeaderStart. ($)
2. gpsSeperator. (,)
3. gpsDelimiter. (\n)
4. gpsCurrentChar.
5. gpsTempVar.

Header That is used:


$GPRMC,225446,A,4916.45,N,12311.12,W,000.5,054.7,191194,020.3,E*68

225446 Time of fix 22:54:46 UTC


A Navigation receiver warning A = OK, V = warning
4916.45,N Latitude 49 deg. 16.45 min North
12311.12,W Longitude 123 deg. 11.12 min West
000.5 Speed over ground, Knots
054.7 Course Made Good, True
191194 Date of fix 19 November 1994
020.3,E Magnetic variation 20.3 deg East
*68 mandatory checksum
Logic:
getGpsData()
{
If(startGpsDataRx)
{
if gpsCurrentChar is ‘$’, then set gpsHeaderStart,
Else if(gpsHeaderStart is set AND gpsCurrentChar is ‘,’) then gpsSeperator++;
Else if(gpsHeaderStart is set AND gpsSeperator==3)
{
tempGpsLatVal[gpsTempVar]=gpsCurrentChar;
if(gpsTempVar==7)
{
gpsCurrentLatVal=tempGpsLatVal;
gpsTempVar=0;
} gpsTempVar++;
}
Reset startGpsDataRx;
Enable the interrupt;
}
}
gpsDataRxIntr()
{
gpsCurrentChar=received char;
set startGpsDataRx;
Disable the intr;
}

You might also like