Shop OBEX P1 Docs P2 Docs Learn Events
GPS Receiver Module - Raw Mode — Parallax Forums

GPS Receiver Module - Raw Mode

VanceShelleyVanceShelley Posts: 1
edited 2010-08-12 11:05 in Accessories
Hello everyone.

I have scoured the forums and can't seem to find anyone that's using RAW mode on the GPS Receiver Module(item code #28146). I have pulled /RAW LOW and receive garbage data. Smart mode works just fine. I can send the !GPS commands and get the replies perfectly. However, I'm more interested in just receiving the NMEA sentances at 1Hz.

The baud setting (4800,n,8,1) is the same baud setting used in smart mode, so I'm sure the baud is ok, but in my experience with modems back in the day, the data looks more like it has a parity or baud rate error. The length of the data appears to be appropriate, but it appears to be random characters.

The only thing I can think of at this point is that the data must be coming in too fast for me to fire it off one byte at a time to the debug port, but I would expect to at least be seeing recognizable portions of the NMEA sentences if that was the case.


So I submit to you, my fellow Parallax People, I am in need of help.

Below you will find the code I am using.

Thanks!!


' {$STAMP BS2}
' {$PBASIC 2.5}


SI              PIN     1               ' serial input
RAW             PIN     4               '/raw
sData           VAR     Byte            ' data buffer

open            CON     $8000
T2400           CON     396
T4800           CON     188
T9600           CON     84

baud            CON     T4800

GetInfo         CON     $00
GetValid        CON     $01
GetSats         CON     $02
GetTime         CON     $03

ver_hw          VAR     Byte
ver_fw          VAR     Byte
tmHr            VAR     Byte
tmMin           VAR     Byte
tmSec           VAR     Byte
sats            VAR     Byte

smartMode       VAR     Bit


smartMode = 1

IF (smartMode = 0) THEN SetRaw
HIGH RAW
GOTO Init

SetRaw:
LOW RAW


Init:
INPUT SI
DEBUG "Beginning...", CR

Main:
IF (smartMode = 0) THEN RawInput

      SEROUT SI, baud, ["!GPS", GetTime]
      SERIN SI, baud, 3000, Init, [tmHr, tmMin, tmSec]
      DEBUG CLS, "Time of day (UTC): ", DEC2 tmHr, ":", DEC2 tmMin, ":", DEC2 tmSec, CR
      'SERIN SI, 188, 3000, Init, [ver_hw, ver_fw]
      'SERIN SI, baud, 3000, Init, [sats]
      'DEBUG HEX ver_hw.HIGHNIB, ".", HEX ver_hw.LOWNIB, CR
      'DEBUG HEX ver_fw.HIGHNIB, ".", HEX ver_fw.LOWNIB, CR
      'DEBUG sats, CR

      PAUSE 500
      'This delay is set to 500ms, because of the delay in the Smart Mode
      'is about 500ms also, so the update freq. is 1Hz.  If you change it to
      'Pause 1000, you'll see the time jump in increments of 2 seconds
      ' sometimes.

      GOTO Main

RawInput:
      SERIN SI, baud, 3000, Init, [sData]
      DEBUG sData
      GOTO Main

Comments

Sign In or Register to comment.