• 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
  • Recent Activity


    Hx711 calibration

    Thread Starter: amod

    Iam using load cell amplifier HX711 module.I have got raw values from module but iam not able to calibrate with load cell.I want make a universal...

    joesaliba Yesterday, 15:48 Go to last post