GPS decoding problems


Results 1 to 17 of 17

Threaded View

  1. #4
    Join Date
    Jul 2006
    Location
    Surrey, BC, Canada
    Posts
    31


    Did you find this post helpful? Yes | No

    Default

    Brian Please Help!
    Please post all code for “Find Field Track Routine”

    I already tested your code and it successfully finding “GPRMC” string and storing data in 65 elements array (memory of PIC16F872 doesn’t allow to create bigger array).
    But still cannot figure out how to find right field and extract numeric data from the string.

    This is a sample of string I have:

    $G,092713.867,A,4913.0722,N,12256.9039,W,1.16,73.6 5,291206,,*20
    $G,092714.867,A,4913.0712,N,12256.9078,W,0.81,78.5 6,291206,,*25 and so on

    Maybe I made mistake in my code?

    '---------------- Definitions---------------------------------------------
    define OSC 20
    '------------- Define LCD registers and bits------------------------------
    Define LCD_DREG PORTB 'Set LCD data port
    Define LCD_DBIT 0 'Set starting data bit
    Define LCD_RSREG PORTB 'Set LCD register select port
    Define LCD_RSBIT 4 'Set LCD register select bit
    Define LCD_EREG PORTB 'Set LCD enable port
    Define LCD_EBIT 5 'Set LCD enable bit
    '------------- Define DEBUG registers and bits----------------------------
    define DEBUG_REG PORTC 'Set DEBUD port
    DEFINE DEBUG_BIT 3 'Set DEBUG pin
    DEFINE DEBUG_BAUD 4800 'Set DEBUG baud rate
    DEFINE DEBUG_MODE 0 'Set DEBUG mode

    '------------Allocate Variables for GPS-----------------------------------
    TimeOut CON 3000 'Time out delay
    baudGPS CON 16572 '16572 - 4800 baud inverted
    ParseCycle var byte ' Parse counter
    commacount var byte 'Commas counter
    e var byte
    GPSdata var byte[65] ' Data array
    TEMPdata var byte ' Temp debug data

    '--------------------- Pins definitions-----------------------------------
    GPSin VAR PORTc.7 'pin
    '-----------------------Program routine-----------------------------------


    GetData:

    serin2 gpsin,baudgps, timeout, nogps,[WAIT("$GPRMC")] ' find start of string
    for ParseCycle = 0 to 64
    serin2 gpsin, baudgps, [GPSdata[ParseCycle]]
    next ParseCycle

    'for parsecycle = 0 to 64 'test routine
    'TEMPdata = gpsdata[parsecycle] 'test routine
    'Debug TEMPdata 'test routine


    FindTrackField:
    commacount = 0
    for ParseCycle = 0 to 64
    e = GPSdata[ParseCycle]
    if e = "," then commacount = commacount + 1
    if commacount = 8 then gosub gettrack 'Track follows 8th comma

    debug e
    'debug " Gps data value ", gpsdata '10 gives MagVar - 8 gives Track

    next ParseCycle


    goto getdata

    Nogps:
    LCDOut $FE, 1 'Clear Screen
    LCDOut "No GPS"
    low portc.0
    Pause 2300
    high portc.0 'error LED flashes
    pause 2300
    low portc.0
    goto getdata


    gettrack:
    lcdout $FE, $01
    lcdout $fe, 1, "Time" 'not finished line
    lcdout $fe, $c0, "Speed " 'not finished line
    return

    Brian, please push me forward one more time.
    Vladimir
    Last edited by vladimir059@hot; - 29th December 2006 at 16:04.

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