Pulling NMEA strings off of the parallax GPS Module
cwolff
Posts: 24
Hello,
I recently purchased a Parallax GPS module and wrote a simple program to pull raw strings off of the unit. But my output looks screwy, can anyone advise how to make nice clean nmea strings come out? Thank you.
' {$STAMP BS2p}
' {$PBASIC 2.5}
'
[noparse][[/noparse] I/O Definitions ]
Sio PIN 10 ' connects to GPS Module SIO pin
Raw CON 7
'
[noparse][[/noparse] Constants ]
T4800 CON 500
Baud CON T4800
i VAR Byte
serdata VAR Byte
Initialize:
LOW Raw
Start:
SERIN Sio,500,[noparse][[/noparse]SPSTR 82 ]
FOR i = 0 TO 81
GET i,serdata
DEBUG serdata
NEXT
DEBUG CR
GOTO start:
$GPGGA,051107,3213.8873,N,11058.1625,W,0,00,,00687.1,M,-027.2,M,,*65
$GPGSA,A,1,,
NI
I recently purchased a Parallax GPS module and wrote a simple program to pull raw strings off of the unit. But my output looks screwy, can anyone advise how to make nice clean nmea strings come out? Thank you.
' {$STAMP BS2p}
' {$PBASIC 2.5}
'
[noparse][[/noparse] I/O Definitions ]
Sio PIN 10 ' connects to GPS Module SIO pin
Raw CON 7
'
[noparse][[/noparse] Constants ]
T4800 CON 500
Baud CON T4800
i VAR Byte
serdata VAR Byte
Initialize:
LOW Raw
Start:
SERIN Sio,500,[noparse][[/noparse]SPSTR 82 ]
FOR i = 0 TO 81
GET i,serdata
DEBUG serdata
NEXT
DEBUG CR
GOTO start:
$GPGGA,051107,3213.8873,N,11058.1625,W,0,00,,00687.1,M,-027.2,M,,*65
$GPGSA,A,1,,
NI
Comments
You will miss entire sentences while synchronization is reestablished, but at least what you read should be intact. If you're only interested in, say, $GPGGA, you could use WAIT("GGA") instead. That way you will be more likely to intercept the stuff you're interested in.
Note: There's a chance that the BS2p won't be able to keep up at 4800 baud using WAIT. You'll just have to experiment with it to see.
-Phil
$GPGSV,3,2,12,1
RMC,060733,A,3213.8585,N,11058.1665,W,000.5,266.2,291207,,,A*63
$GPGGA,060734,321
GSV,3,1,12,01,51,030,34,05,05,041,00,11,34,271,38,14,26,058,32*79
' {$STAMP BS2p}
' {$PBASIC 2.5}
'
[noparse][[/noparse] I/O Definitions ]
Sio PIN 10 ' connects to GPS Module SIO pin
Raw CON 7
'
[noparse][[/noparse] Constants ]
T4800 CON 500
Baud CON T4800
i VAR Byte
serdata VAR Byte
Initialize:
LOW Raw
Start:
SERIN Sio,500,[noparse][[/noparse]WAIT("$GP"),SPSTR 82 ]
FOR i = 0 TO 81
GET i,serdata
DEBUG serdata
NEXT
DEBUG CR
PAUSE 2000
GOTO start: