Using SPSTR for GPS GPRMC
cutsrock
Posts: 32
I am trying to use Nuts & Volts article #83 code with a BS2px, but having dificulty getting the SPSTR instruction to save the GPRMC to Scratch Pad Ram.· I have conditionally compiled the code and I am using the following line to capture the GPRMC string.
SERIN GPSpin, T4800, 3000, No_GPS_Data, [noparse][[/noparse]WAIT("GPRMC,"), SPSTR 65]
The conditional compiling:
'
[noparse][[/noparse] I/O Definitions ]
'
GPSpin········· CON···· 15······················ ' GPS serial input
'
[noparse][[/noparse] Constants ]
'
#SELECT $STAMP
· #CASE BS2, BS2E, BS2PE
··· T1200······ CON···· 813···················· 'INT(1,000,000/Baud)-20
··· T2400······ CON···· 396···················· 'INT(1,000,000/Baud)-20
··· T4800······ CON···· 188···················· 'INT(1,000,000/Baud)-20
··· T9600······ CON···· 84····················· 'INT(1,000,000/Baud)-20
··· T19K2······ CON···· 32····················· 'INT(1,000,000/Baud)-20
··· T38K4······ CON···· 6······················ 'INT(1,000,000/Baud)-20
· #CASE BS2SX, BS2P
··· T1200······ CON···· 2063··················· 'INT(2,500,000/Baud)-20
··· T2400······ CON···· 1021··················· 'INT(2,500,000/Baud)-20
··· T4800······ CON···· 500···················· 'INT(2,500,000/Baud)-20
··· T9600······ CON···· 240···················· 'INT(2,500,000/Baud)-20
··· T19K2······ CON···· 110···················· 'INT(2,500,000/Baud)-20
··· T38K4······ CON···· 45····················· 'INT(2,500,000/Baud)-20
· #CASE BS2PX
··· T2400······ CON···· 1646··················· 'INT(4,000,000/Baud)-20
··· T4800······ CON···· 813···················· 'INT(4,000,000/Baud)-20
··· T9600······ CON···· 396···················· 'INT(4,000,000/Baud)-20
··· T19K2······ CON···· 188···················· 'INT(4,000,000/Baud)-20
··· T38K4······ CON···· 84····················· 'INT(4,000,000/Baud)-20
#ENDSELECT
When I try to Print the string or any variable after parsing I get nothing.
I am sure it is somthing simple I am missing.
The GPS unit is a Garmin 16 HVS and I can config it's baud rate up to T38K4 and to output one or more·NEMA sentences.
I have attached the NV83 code as I revised it to work with the BS2px.
Any suggestions.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
EPIC FAILURE -·When everyday run-of-the-mill failure just isn't good enough.
SERIN GPSpin, T4800, 3000, No_GPS_Data, [noparse][[/noparse]WAIT("GPRMC,"), SPSTR 65]
The conditional compiling:
'
[noparse][[/noparse] I/O Definitions ]
'
GPSpin········· CON···· 15······················ ' GPS serial input
'
[noparse][[/noparse] Constants ]
'
#SELECT $STAMP
· #CASE BS2, BS2E, BS2PE
··· T1200······ CON···· 813···················· 'INT(1,000,000/Baud)-20
··· T2400······ CON···· 396···················· 'INT(1,000,000/Baud)-20
··· T4800······ CON···· 188···················· 'INT(1,000,000/Baud)-20
··· T9600······ CON···· 84····················· 'INT(1,000,000/Baud)-20
··· T19K2······ CON···· 32····················· 'INT(1,000,000/Baud)-20
··· T38K4······ CON···· 6······················ 'INT(1,000,000/Baud)-20
· #CASE BS2SX, BS2P
··· T1200······ CON···· 2063··················· 'INT(2,500,000/Baud)-20
··· T2400······ CON···· 1021··················· 'INT(2,500,000/Baud)-20
··· T4800······ CON···· 500···················· 'INT(2,500,000/Baud)-20
··· T9600······ CON···· 240···················· 'INT(2,500,000/Baud)-20
··· T19K2······ CON···· 110···················· 'INT(2,500,000/Baud)-20
··· T38K4······ CON···· 45····················· 'INT(2,500,000/Baud)-20
· #CASE BS2PX
··· T2400······ CON···· 1646··················· 'INT(4,000,000/Baud)-20
··· T4800······ CON···· 813···················· 'INT(4,000,000/Baud)-20
··· T9600······ CON···· 396···················· 'INT(4,000,000/Baud)-20
··· T19K2······ CON···· 188···················· 'INT(4,000,000/Baud)-20
··· T38K4······ CON···· 84····················· 'INT(4,000,000/Baud)-20
#ENDSELECT
When I try to Print the string or any variable after parsing I get nothing.
I am sure it is somthing simple I am missing.
The GPS unit is a Garmin 16 HVS and I can config it's baud rate up to T38K4 and to output one or more·NEMA sentences.
I have attached the NV83 code as I revised it to work with the BS2px.
Any suggestions.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
EPIC FAILURE -·When everyday run-of-the-mill failure just isn't good enough.
Comments
It’s not clear from your post where you’re having a problem. The GPS String is in the scratchpad and not a variable. So the question is how are you getting the scratchpad data into the variables? The Nuts & Volts article had a subroutine that did that work for you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
My GPS is sending data because the code does not goto -NO_GPS_DATA- unless I disable the GPSpin or turn off the GPS. The GPS is configurable to different baud rates and can be done with a config program provided by Garmin or through it's input pin.· At this time the GPS Baud rate is 4800.
I have connected the GPS output pin (Data Out) to different pins in the BS2px. Pins 1, 2, 14, 15 have been used. After re-reading the Data sheets and Pbasic help it would seem that to be safe a 22K ohm resistor should be place on the input pin. I am about to try that.
I have a second BS2px that I can try if need be.
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
EPIC FAILURE -·When everyday run-of-the-mill failure just isn't good enough.
Post Edited (cutsrock) : 3/8/2008 12:01:00 AM GMT
-Phil
Post Edited (Phil Pilgrim (PhiPi)) : 3/8/2008 12:09:19 AM GMT
Inverted CON $4000
Baud CON T4800 + Inverted ' baud rate for GPS
Then changed the SERIN command to,
SERIN GPSpin, Baud, 3000, No_GPS_Data, [noparse][[/noparse]WAIT("GPRMC,"), SPSTR 65]
and got the expected results.
Now to incorporate a LCD and apply the BS2px to a super carrier board or get a PCB made for the components needed to finish my project.
Thanks again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
EPIC FAILURE -·When everyday run-of-the-mill failure just isn't good enough.