GPS module + PIC


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938

    Default GPS module + PIC

    Hello,

    I'm trying to communicate with a GPS module http://www.futurlec.com/GPS.shtml.

    Before I connect it to a PIC+LCD, I try to communicate with the GPS module via a PC terminal.

    Unfortunately, I can't get any "understandable" message from the module; I might receive SIRF information instead of NMEA messages, I don't know.

    This is what I see on my terminal:
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=4175&stc=1&d=127083345 4">

    If my guess is right, I would need to switch from SIRF to NMEA protocol. There are to examples hereunder in the doc (full doc attached).
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=4174&stc=1&d=127083336 4">

    I don't understand how to calculate the checksum.

    I found a cool checksum calculator, HashCalc from SlavaSoft Inc. But I can't find a similar checksum corresponding to both examples.

    Can someone tell me in "simple words" how the checksum in both samples above have been calculated and the exact string I would have to send the data to the module?

    Is it "$PSRF100,1,4800,8,1,0*0D0A" or "$PSRF100,1,4800,8,1,0*0D,0A" or "$PSRF100,1,4800,8,1,0*<0D><0A>" or anything else?

    I've spent quite a few hours on this one and no success so far so any help or info is very welcome
    Attached Images Attached Images    
    Attached Images Attached Images
    Roger

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    You need an inverter chip or circuit . (MAX232)
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default

    Thanks Dave,

    The MAX232 in my drawer did the trick

    Any idea about the checksum calculation?

    This is what I did up to now in EXCEL but trying to convert HEX to BIN will rise an error.

    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=4178&stc=1&d=127089284 5">
    Attached Images Attached Images  
    Roger

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    10001000000
    is the number excel failed on but other than that I do not know. I will have to look into it.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Check Sum

    Here is one check sum solution for gps:

    Code:
    gpsdata         var byte[82]       ' Max length of a GPS sentence is 82 bytes.
    
    DoCS:
        i = 0                             ' Initialize the position counter
                    
        WHILE gpsdata[i] != "*"           ' Count everthing until the *
            cs = cs ^gpsdata[i]           ' XOR for checksum
            i = i + 1                     ' Increment position counter
        WEND
    
        ' A quick and easy atoh function
        ' Make it a seperate label if we add more atoh conversions in the future
        LOOKDOWN gpsdata[i+1],["0123456789ABCDEF"],tempbyte
        gpscs = tempbyte * 16        
        LOOKDOWN gpsdata[i+2],["0123456789ABCDEF"],tempbyte                
        gpscs = gpscs + tempbyte
            
        ' Flag bad data "V" if checksum doesn't add up. 
        ' Or if the sentence is less then 20 chars long
        ' Which means there is no active waypoint to go to.
        ' Should be "A" otherwise.
        IF (cs != gpscs) OR (i < 20 )THEN 
              gpsvalid = 0
        ELSE 
              gpsvalid = 1
        ENDIF   
    RETURN
    Last edited by ScaleRobotics; - 10th April 2010 at 13:26.

  6. #6
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Can't "talk" towards my GPS module...

    - Reading & parsing NMEA sentences is ok;
    - Calculating checksum is ok;
    - Sending data to GPS module is not ok.

    I have connected the GPS module via the MAX232 chip to my serial PC port both ways so I should be able to "talk" to my module.

    Unfortunately, only reading out (receiving) the GPS module is working.

    I checked the MAX chip with my oscillo and the signals are okay (TX & RX) on both levels (RS232 and TTL).

    I'm sending an example from the module's datasheet to enable a VTG sentence but it won't work.

    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=4205&stc=1&d=127141338 1">

    I just never see this VTG data appear.

    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=4207&stc=1&d=127141381 2">

    Any idea?
    Attached Images Attached Images   
    Roger

  7. #7
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Product specs and supplier

    Just for the record, I found the supplier's website for the GPS module I use; it is http://www.globalsat.com.tw/ and the specific module is here: http://www.globalsat.com.tw/products...t_cnt_folder=2.
    Roger

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts