Shop OBEX P1 Docs P2 Docs Learn Events
GPS Receiver module — Parallax Forums

GPS Receiver module

Dave EDave E Posts: 52
edited 2010-07-01 01:08 in Accessories
Question: When using the Parallax GPS module in smart mode, does the order in which info bytes are requested matter?

I am requesting 4 units of info, namely, data validity (one byte, command $01), number of satellites tracked (one byte, $02), time (three bytes, $03)·and altitude (two bytes, $07). If·I request the data in that order then everything works well. However, if I request the number of sats then altitude the altitude is wrong. Also, if I request the altitude then # of sats, the # of sats is wrong (varies from 20 to 27).

It seems that as long as I request other data between the requests for altitude and sats everything is fine. If I request sats and altitude one after the other,·whichever the·second one is will be wrong.

Does anyone have any ideas?

Dave E

PS
I am using a microcontroller from another manufacturer.

Can post code, if needed.

Comments

  • Joe GrandJoe Grand Posts: 70
    edited 2010-06-30 04:43
    Hi Dave-

    The order in which you request data from the GPS module shouldn't matter. My only thought is that since the module gets a new NMEA string (at a rate of once per second) for each request, the data is changing in between the calls (hence your varying altitude or number of satellites). 20-27 seems out of range for number of satellites, so maybe there's a data parsing error in your code.

    Take care,

    Joe

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ---

    Joe Grand
    Grand Idea Studio, Inc.
    Designer of the Parallax Emic Text-to-Speech, RFID, and GPS modules
  • Dave EDave E Posts: 52
    edited 2010-07-01 01:08
    Hi Joe,

    Thanks for the reply. In that case I may not be using smart mode correctly.·I send a request (SEROUT) then receive (SERIN)·a byte or three depending on what is being requested. My code is below (partial listing).

    As listed below, time is correct, valid bit is correct (red led is on), # sats seems correct, altitude is showing 9985 feet. I am at about 1000 feet above sea level.

    If I move the GET_ALTITUDE call before the GET_SATNUM call then altitude displays 1015 feet and # sats is 1 even though the red led is on.

    However, if I place either of the other 2 GOSUB calls in between the satnum and altitude calls everything seems to be fine. valid=1, sats=6, alt=1014, time=1:8:45 GMT.

    Hardware and firmware versions are both 1.6.

    Thanks for any help you can give.



    '
    MAIN

    DO
    ·TOGGLE LED

    ·GOSUB GET_TIME
    ·GOSUB GET_VALID
    ·GOSUB GET_SATNUM
    ·GOSUB GET_ALTITUDE
    LOOP

    '
    SUBROUTINES

    GET_VALID:
    ·SEROUT GPSPIN, GPSBAUD, ("!GPS", $01)
    ·SERIN [noparse][[/noparse]3000, HERE], GPSPIN, GPSBAUD, VALID
    ·SEROUT LCD, BAUD, (134, " ", 134, #VALID)
    RETURN

    GET_SATNUM:
    ·SEROUT GPSPIN, GPSBAUD, ("!GPS", $02)
    ·SERIN [noparse][[/noparse]3000, HERE], GPSPIN, GPSBAUD, SATNUM
    ·SEROUT LCD, BAUD, (148, "·· ", 148, #SATNUM)
    RETURN

    GET_TIME:
    ·SEROUT GPSPIN, GPSBAUD, ("!GPS", $03)
    ·SERIN [noparse][[/noparse]3000, HERE], GPSPIN, GPSBAUD, HRS, MINS, SEC
    ·SEROUT LCD, BAUD, (136, "······· ", 136, #HRS, ":", #MINS,":", #SEC)
    RETURN

    GET_ALTITUDE:
    ·SEROUT GPSPIN, GPSBAUD, ("!GPS", $07)
    ·SERIN [noparse][[/noparse]3000, HERE], GPSPIN, GPSBAUD, B7, B6
    ·ALTITUDE = ALTITUDE ** 21501·'CONVERT TO FEET
    ·SEROUT LCD, BAUD, (151, "···· ", 151, #ALTITUDE)
    RETURN



    Post Edited (Dave E) : 7/10/2010 2:20:16 AM GMT
Sign In or Register to comment.