GPS module PMB-248 help
Hello,
I received a GPS module and installed it in a BS2 P3.
I´m trying to get readings from it, and all that I get is a sequence of "6". Since the module do have an RX pin, I don´t know if some command must be sent prior to read Tx bytes. I did not find information on Parallax website. If somebody can help, it will be appreciated.
thanks.
the code I´m using:
'{$STAMP BS2}
'Program to read in GPS coordinates from the NMEA 0183 GPRMC statement
gpstime VAR Word
N VAR Word
W VAR Word
NN VAR Word
WW VAR Word
speed1 VAR Word
speed2 VAR Nib
course1 VAR Word
course2 VAR Nib
'Baud rates:
'16572 = 4800 baud BSII Chip
'16468 = 9600 baud BSII Chip
n9600 CON 16468
n4800 CON 16572
SEROUT 16,n9600,[noparse][[/noparse]"sistema GPS by Feijo"]
main:
'Get next GPS RMC statement at 4800 baud pin 3
SERIN 3,n4800,2100,noGPS1,[noparse][[/noparse]DEC gpstime, SKIP 3, DEC N, DEC NN, SKIP 3, DEC W, DEC WW, SKIP 3,DEC speed1, DEC speed2, DEC course1,DEC course2]
GOSUB output1
GOTO main
'******************************************* OUTPUT ROUTINE *******************************************
output1:
'output to terminal at 4800 baud
DEBUG DEC gpstime,",",DEC W
IF WW < 10 THEN gps1
IF WW < 100 THEN gps2
IF WW < 1000 THEN gps3
DEBUG ".",DEC WW
GOTO gpsNN
gps1:
DEBUG ".000",DEC WW
GOTO gpsNN
gps2:
DEBUG ".00",DEC WW
GOTO gpsNN
gps3:
DEBUG ".0",DEC WW
GOTO gpsNN
gpsNN:
DEBUG ",W,",DEC N
IF NN < 10 THEN gps4
IF NN < 100 THEN gps5
IF NN < 1000 THEN gps6
DEBUG ".",DEC NN
GOTO gpsend
gps4:
DEBUG ".000",DEC NN
GOTO gpsend
gps5:
DEBUG ".00",DEC NN
GOTO gpsend
gps6:
DEBUG ".0",DEC NN
GOTO gpsend
gpsend:
DEBUG ",N,"
'End Data output from GPS
DEBUG DEC speed1,".",DEC speed2,",",DEC course1,".",DEC course2,10,13
RETURN
'************************************** GPS Not Detected Routine ***************************************
'(having the Debug statement here will cause the debug window to come automatically but not interfere with data collection in HyperTerminal)
nogps1:
DEBUG "no gps",CR
GOTO MAIN
I received a GPS module and installed it in a BS2 P3.
I´m trying to get readings from it, and all that I get is a sequence of "6". Since the module do have an RX pin, I don´t know if some command must be sent prior to read Tx bytes. I did not find information on Parallax website. If somebody can help, it will be appreciated.
thanks.
the code I´m using:
'{$STAMP BS2}
'Program to read in GPS coordinates from the NMEA 0183 GPRMC statement
gpstime VAR Word
N VAR Word
W VAR Word
NN VAR Word
WW VAR Word
speed1 VAR Word
speed2 VAR Nib
course1 VAR Word
course2 VAR Nib
'Baud rates:
'16572 = 4800 baud BSII Chip
'16468 = 9600 baud BSII Chip
n9600 CON 16468
n4800 CON 16572
SEROUT 16,n9600,[noparse][[/noparse]"sistema GPS by Feijo"]
main:
'Get next GPS RMC statement at 4800 baud pin 3
SERIN 3,n4800,2100,noGPS1,[noparse][[/noparse]DEC gpstime, SKIP 3, DEC N, DEC NN, SKIP 3, DEC W, DEC WW, SKIP 3,DEC speed1, DEC speed2, DEC course1,DEC course2]
GOSUB output1
GOTO main
'******************************************* OUTPUT ROUTINE *******************************************
output1:
'output to terminal at 4800 baud
DEBUG DEC gpstime,",",DEC W
IF WW < 10 THEN gps1
IF WW < 100 THEN gps2
IF WW < 1000 THEN gps3
DEBUG ".",DEC WW
GOTO gpsNN
gps1:
DEBUG ".000",DEC WW
GOTO gpsNN
gps2:
DEBUG ".00",DEC WW
GOTO gpsNN
gps3:
DEBUG ".0",DEC WW
GOTO gpsNN
gpsNN:
DEBUG ",W,",DEC N
IF NN < 10 THEN gps4
IF NN < 100 THEN gps5
IF NN < 1000 THEN gps6
DEBUG ".",DEC NN
GOTO gpsend
gps4:
DEBUG ".000",DEC NN
GOTO gpsend
gps5:
DEBUG ".00",DEC NN
GOTO gpsend
gps6:
DEBUG ".0",DEC NN
GOTO gpsend
gpsend:
DEBUG ",N,"
'End Data output from GPS
DEBUG DEC speed1,".",DEC speed2,",",DEC course1,".",DEC course2,10,13
RETURN
'************************************** GPS Not Detected Routine ***************************************
'(having the Debug statement here will cause the debug window to come automatically but not interfere with data collection in HyperTerminal)
nogps1:
DEBUG "no gps",CR
GOTO MAIN