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


    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

  2. #2
    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.

  3. #3
    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 14:26.

  4. #4
    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

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


    Did you find this post helpful? Yes | No

    Default It works now!

    Strange....

    I just restarted the terminal and... it works now - I can sent messages to the module.

    Must be a kind of magic (?)
    Roger

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default

    Is it Hyperterminal?

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default

    No, it's MicroCode Studio's terminal.

    But I checked with HT too and did the same (?).

    Nevermind, it works now
    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