4.9.4 GPS statement
The GPS statement switches on the GPS receiver module. It waits for a satellite lock to be
obtained, then sets the computer’s real time clock, and other parameters such as the altitude,
latitude, longitude etc. The GPS statement also calibrates the oscillation value of the 8MHz system
clock oscillator and PLL reference frequency.
Syntax:
GPS <timeout expression>
GPS <timeout expression> <command string>
GPS <command string>
There are several ways to use the command. The typical usage is GPS with a single parameter,
the timeout expression. This specifies the number of seconds to wait for a GPS 3D satellite lock,
before giving up and proceeding with the next line of the program. This command switches on the
GPS, waits for satellite lock, sets real time clock and other GPS parameters such as altitude,
latitude, longitude; then runs an oscillator calibration (system clock and PLL reference oscillator),
before finally powering down the GPS.
A command string may also be passed to the GPS to alter its behavior. Command strings use a
checksum as the last two characters, and there are online tools for calculating this parameter.
When a command string is specified, the system waits 2 seconds for a response from the GPS; if
none is received (which is typically the case if an unsupported command was given), it proceeds
with the rest of the GPS operation.
The final way to use the GPS command is by passing a command string only. This differs in so far
as the system waits 2 seconds for a response from the GPS, then abandons the command if no
response is received; the important point is that the GPS is NOT powered down; this means that
the effects of the command are retained, because the GPS still has power applied. This is
essential if you wish to configure the GPS with more than one command, because otherwise they
would be forgotten immediately when the GPS is powered down.
Examples:
GPS 300
Powers on the GPS, waits for satellite lock; sets GPS variables and does calibration. If the
procedure is not completed in 300 seconds, the command is abandoned. At the end of the
command (or when it is abandoned), the GPS is powered down.
GPS 300 “$PMTK605*31”
This does the same thing, but first sends the command $PMTK605*31 to the GPS and waits up to
2 seconds for an answer.
GPS “$PMTK605*31”
sends the command to the GPS, and waits up to 2 seconds for an answer, but does NOT then
power down the GPS.
U4B operating manual Rev 1.00
39
Содержание U4B Ultimate4
Страница 54: ...U4B operating manual Rev 1 00 54...