GPS decoding problems


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default here's how I do it

    Here is how I decode the $gprmc sentence...

    Partial code below

    Code:
    GPRMC VAR BYTE[64]
    
    hh      VAR BYTE  'hours
    mm      VAR BYTE  'minutes
    ss      VAR BYTE  'seconds
    sss     var word  'milliseconds
    fix     VAR WORD  'GPS fix
    latdeg  VAR BYTE  'degrees latitude
    latmin  VAR BYTE  'minutes latitude  
    latminn var word  'fractional minutes latitude
    NS      VAR BYTE  'north or south
    londeg  VAR BYTE  'degrees longitude
    lonmin  VAR BYTE  'minutes longitude
    lonminn var word  'fractional minutes longitude
    EW      VAR BYTE  'east or west
    Knots   VAR byte  'speed in knots (units)
    Knotss  var byte  'speed in fractional knots
    course  var word  'heading
    dy      VAR BYTE  'day
    mt      VAR BYTE  'month
    yr      VAR BYTE  'year
    
    
    '============= Main Program ==========================================
    Main:
    high gpwr
    pause 3000
    
    GPSin:
        serin2 gps,188,3000,tmout,[WAIT("$GPRMC,"),STR GPRMC\63\"$"] 'Data IN from GPS
        
        arrayread gprmc,[DEC2 hh,DEC2 mm,dec2 ss,_
          wait(","),fix,wait(","),DEC2 latdeg,DEC2 latmin,wait("."),dec4 latminn,_
          wait(","),NS,wait(","),DEC3 londeg,DEC2 lonmin,wait("."),dec4 lonminn,_
          wait(","),EW,wait(","),dec knots,dec Knotss,dec course,_
          wait(","),DEC2 dy,DEC2 mt,DEC2 yr]      'parse the GPS array into parts
    
    if fix = "V" then gpsin  'jump to "waiting for fix" display
    
    low gpwr
    high xpwr
        pause 1000
        
        SEROUT2 xbtx,188,[$0D,$0A,"$GPRMC,",STR GPRMC\63]            'Data OUT to XBEE
        pause 500
    Hope this helps
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  2. #2
    Join Date
    Apr 2010
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    Thanx so much .. I really appreciate it
    Could you please provide me with GPS hardware connections with the pic ?

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


    Did you find this post helpful? Yes | No

    Default

    What are you using for the GPS? A handheld unit or a module?
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Apr 2010
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    What are you using for the GPS? A handheld unit or a module?
    I am using a module.

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


    Did you find this post helpful? Yes | No

    Default

    The module data sheet should give the pin out. RX and TX.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Apr 2010
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    The module data sheet should give the pin out. RX and TX.
    Thanks, but to which pins of the pic16f877 should these pins be connected ??

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


    Did you find this post helpful? Yes | No

    Default

    Well.... Back to the data sheet if you are planning to use the USART. Pins RC6 and 7.

    If you are going to use SERIN2 then just about any of the pins will work.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. GPS $GPRMC to PIC16F684. Need help with SERIN2
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th November 2009, 09:47
  2. GPS clock timing !
    By bethr in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 3rd July 2008, 20:11
  3. Replies: 2
    Last Post: - 28th April 2006, 12:10
  4. GPS Receiver
    By lester in forum Adverts
    Replies: 2
    Last Post: - 22nd February 2006, 12:47
  5. GPS decoding
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th May 2005, 20:42

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