• PicŪ Basic


  • GPS NMEA decode using comma count

    Decoding NMEA strings can be a little hit and miss, especially if the method counts in from the start of the string.
    A more certain method of extracting values is to count commas. If a particular GPS does not insert values for a particular item in the string there is no false allocation. The strings used here are those that are standard, so all (most?) GPSs should work with the code.

    If an item is missing e.g. the altitude is not provided, the program allocates 'N/A' to the extracted string.

    I've used a 16F628A as it is supported by both the free version of Proton and the demo version of ISIS (use PIC16_18PIN_VHB.DSN). I've used almost all of the variable space, mostly with the byte arrays but for a demo that is unimportant. You may not need to extract as many items as I have illustrated in which case there will be more RAM space available. Alternatively, use a PIC with more RAM.

    The attached is a working program for the demonstration version of ISIS. The HRSin functions are commented out and test strings are provided. Give it a trial in ISIS first of all to get an idea of how it works.

    I have formatted the time and date to demonstrate one way to do this. I have also decoded the Fix information to demonstrate how to convert to a numeral and then use the value to put an appropriate message on screen. A similar principle could be used to change the Lat/Long information to decimal degrees or degrees/minutes/seconds.

    The program's HRSin has been set to 9600baud. More recent GPS devices seem to use 9600 while older devices use 4800baud.

    John Drew
    VK5DJ
    GPScommas.zip
  • Recent Activity

    See_Mos-247

    Mysterious PORTB problem

    Thread Starter: xldaedalus

    I'm using Proton+ to develop firmware for a product with switches. The MCU is an 18F26K22. Most of the switches reside on PORTB. I am NOT using a...

    See_Mos Yesterday, 10:05 Go to last post
    towlerg-21522

    Pic16f18877 oread

    Thread Starter: evoortman

    Hi, On a PIC16F18877 the OREAD command doesn't seem to work. The code is working on a PIC16F1939. Both controllers use 32MHz int osc. If i...

    towlerg Yesterday, 13:23 Go to last post