How do I discern Maidenhead Locator from GPS lat long info.


Closed Thread
Results 1 to 40 of 126

Hybrid View

  1. #1
    Join Date
    Oct 2010
    Posts
    413

    Default Re: How do I discern Maidenhead Locator from GPS lat long info.

    This weekend i will try to make some changes. I also found out that the NMEA sentence $GPVTG (from a chip MT3339) or $GNVTG (from a chip MT3333, with GLONASS) has the info of the speed in Km/h so it will be simpler to display speed at km/h.

  2. #2
    Join Date
    Oct 2010
    Posts
    413

    Default Re: How do I discern Maidenhead Locator from GPS lat long info.

    ok it is being some time since i made a change to the code. These days i l was trying to figure out how to embed the speed in my code. I left the part of the code with Days, Months, Years, on a side for a while.

    Tomorrow i will upload the code with the speed embeded, and the limits at 10Km/h, 50Km/h, 100Km/h. I have placed for the indication of each limit some LEDs at A Port.

    I have also noticed that code is expanding, and at the end i might need a bigger PIC chip.
    Last edited by astanapane; - 11th June 2018 at 22:29.

  3. #3
    Join Date
    Oct 2010
    Posts
    413

    Default Re: How do I discern Maidenhead Locator from GPS lat long info.

    These days i tried to use the $GPVTG sentence and get the speed from there as it is in Km/h

    First of all the format of the $GPVTG sentence is as follows.

    1. X.XX for the left X before the "dot" when the speed is less than 10km/h
    2. XX.XX for the XX before the "dot" when the speed is more than 9 km/h and less than 100km/h
    2. XXX.XX for the XXX before the "dot" when the speed is more than 99km/h

    For the .XX so the two digits after the "dots" those are the decimal part and stays stable in the $GPVTG sentence.

    We need to check when the speed change, where is the dot.

    Code:
    serin2 gps_tx,84,timeout,lostcable,[wait("GPVTG"),wait("N"),_
    wait(","),TS[0],TS[1],TS[2],TS[3],TS[4],_
    wait(","),SKIP 3]
    
    for i = 1 to 3
        if TS[i]="." then decimal = i   'TOTAL SPEED. find which character is the decimal point 
        next i
    
    select case decimal 'if the gps shows 1.45 it may be 145
                        'for the conversion ASCII to number we can use the -48
        case    1       'decimal position is x.xx
            speed = (10*(TS[0]-48))+(TS[2]-48)
        case    2       'decimal position is xx.xx
            speed = (100*(TS[0]-48))+(10*(TS[1]-48))+(TS[3]-48)
        case    3       'decimal position is xxx.xx
            speed = (1000*(TS[0]-48))+(100*(TS[1]-48))+(10*(TS[2]-48))
        end select     
        
    gosub OVERSPEED:
    
    
    OVERSPEED: 
    
    if SPEED > 1000 then     ' 100Km/h
        high porta.3
        low  porta.2
        low  porta.1    
    else
        LOW porta.3
        
    if SPEED > 500 then     ' 50Km/h
        high porta.2
        low  porta.1    
    else
        LOW porta.2
        
    if SPEED > 100  then    ' 10Km/h
        high porta.1
    else
        LOW porta.1
    
    endif
        endif
            endif
        return
    At the moment the code is working as it is, but i think i need to change the multiplication of 10*, 100* and 1000*, to 1*, 10* and 100*, because as you see at the OVERSPEED: i use 1000 for the 100 km/h, 500 for the 50km/h and 100 for the 10km/h.
    But then the dot will change place, or i will not being able to identify the right place of it. Anyhow the code is working for the speed.

    Still i need to:

    1. Make the Day/Month/Year to work properly, now i think i will not have a problem to solve this.

    2. The display data are refreshed, my goal is to make the data stable all the time at the screen and change only the needed values.
    Attached Images Attached Images   

  4. #4
    Join Date
    Oct 2010
    Posts
    413

    Default Re: How do I discern Maidenhead Locator from GPS lat long info.

    Could you tell me if it is a good choise continuing this project with PIC16f887 i/p?

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653

    Default Re: How do I discern Maidenhead Locator from GPS lat long info.

    Could you tell me if it is a good choise continuing this project with PIC16f887
    its basically the same very limited chip you are presently using with a few more pins.
    if you are serious in wanting to calculate maidenhead then no its a poor choice.
    at least get something like 16f18326 ,16f18875 or better still a pic18 chip
    I like pic18f26k42 [if you have pbp3.1] or a pic18f26k22 with pbp3.0 for this sort of project
    Warning I'm not a teacher

  6. #6
    Join Date
    Oct 2010
    Posts
    413

    Default Re: How do I discern Maidenhead Locator from GPS lat long info.

    Hi Richard,

    thanks a lot again for your reply. I'm trying to use a chip that i can program with pickit2 as i dont want to spend any money for the pickit 3.

    I'm planning to purchase the PBP3.1 software, than spend for pickit3 hardware. Im happy with pickit 2, and a close supported device as far as i see is the pic18f26k20.

    At the moment in stock i have the pic18f4550, pic16f1939. What is the feature of the pic we are looking for. The CPU SPEED (8bit or 16bit...), the SRAM, timers?

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653

    Default Re: How do I discern Maidenhead Locator from GPS lat long info.

    What is the feature of the pic we are looking for. The CPU SPEED (8bit or 16bit...), the SRAM, timers?

    its not my project I don't know what you have planned but generally speaking if you are dealing with parsing strings from a serial stream , more sram is better ,the possibility of more speed is always better. make sure there is plenty of flash space to hold the program. if its a one off project get the best chip with enough pins and features required .
    if you are going to do large amounts of and/or complex math then pic18's with a hardware multiplier can increase speed and
    reduce code size

    pk2 will program 18fk22 series , once you have used a chip with pps there is no going back. the k42 series chips leave the others in the dust
    Warning I'm not a teacher

Similar Threads

  1. LAT replaces PORT command?
    By markscotford in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd December 2011, 16:37
  2. Need Info for PBP?
    By azmax100 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 30th January 2009, 07:44
  3. Replies: 1
    Last Post: - 27th July 2008, 06:14
  4. dmx info.
    By oscar in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 8th May 2005, 11:54

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