GPS logger?


Closed Thread
Results 1 to 12 of 12

Thread: GPS logger?

Hybrid View

  1. #1
    cosmomen's Avatar
    cosmomen Guest


    Did you find this post helpful? Yes | No

    Default NMEA read

    Hi all,

    I'm looking for a solution to capture NMEA data with a PIC micro and retransmit them on another serial interface... a kind of NMEA repeater.
    My only problem is that fro example GPGAA sentences are not the same lenght:
    $GPGGA,130524,4650.8982,N,01650.2497,E,0,00,,,M,,M ,,*5A
    $GPGGA,170834,4124.8963,N,08151.6838,W,1,05,1.5,28 0.2,M,-34.0,M,,,*75

    I try to mace something like:
    ......

    dim GPGGA[i don't know the lenght] as byte

    SERIN PORTB.0, 16572, [ WAIT( "$GPGGA," ) , STR GPGGA ] 'this would store the string if I would know its lenght
    SEROUT PORTB.2, 16572, ["$GPGGA," , str GPGGA, 10, 13]

    something like this... :-)
    Please help me!!!

  2. #2
    eoasap's Avatar
    eoasap Guest


    Did you find this post helpful? Yes | No

    Default

    this is what i do for GPS data. (simplified, but this will work). NMEA sentences are ended with a CR, LF, so i loop through the data, checking for a CR, once its received i set a flag and pad with zeros. this gives me a constant length output of the complete NMEA sentence without chopping off any data. There are probably more efficient ways which dont add extra bytes, and the loop takes a bit of time, but at least it works

    'record in 70 bytes
    SERIN2 GPS_TXA, GBAUD, [wait("$GPGGA"),str GPGGA_IN\80]


    'CLEAN UP THE GPGGA Read
    CR_BYTE = 0
    for i = 0 to 77
    if GPGGA_IN[i] = 13 then
    CR_BYTE = 1 'set flag that CR has been recorded
    GPGGA_IN[i] = 160 'replace CR with a space
    endif

    if CR_BYTE = 1 then
    GPGGA_IN[i] = 160 'pad with zeros
    endif
    next i
    GPGGA_IN[78] = 13
    GPGGA_IN[79] = 10

    'END CLEAN GPRMC READ

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, 10:47
  2. Replies: 1
    Last Post: - 27th July 2008, 07:14
  3. GPS clock timing !
    By bethr in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 3rd July 2008, 21:11
  4. Replies: 2
    Last Post: - 28th April 2006, 13:10
  5. GPS Receiver
    By lester in forum Adverts
    Replies: 2
    Last Post: - 22nd February 2006, 13:47

Members who have read this thread : 0

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