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
    Dec 2011
    Location
    IO93ok
    Posts
    190

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

    Surprisingly I do have it in asm if that helps. I think this is the applicable code after GPS string is parsed. Loc 1 to 8 are the Maidenhead.

    I wanted it all in PBP so I could do what I wanted to achieve. The final two are numeric digits. Mine is 03 if that helps re the original code.

    Code:
    ;'''''''''''''''  Process LONG term '''''''''''''''''''''''''''''''''
        bcf     STATUS, C
        rrf     LongD           ;Easiest to work with LongD/2 everywhere
        btfss   STATUS, C       ;  as Loc works on 2 deg intervals
        goto    NoLongMinsUpdate    
                                
        movlw   LOW(d'6000')    ;Add 1 degree's worth of carry into the 
        addwf   LongMLo         ;   minutes registers if LongD/2 has a carry
        btfsc   STATUS, C
        incf    LongMHi
        movlw   HIGH(d'6000')   ;LongM in range 0 -  12000
        addwf   LongMHi
    NoLongMinsUpdate            ;LongD' now in range 0 - 90
        btfss   NEGLONG
        goto    PosLong
        comf    LongD
        incf    LongD           ;LongD' now in 2's complement +/-90
        
        movf    LongMLo, w      ;Normalise LongM = 12000 - LongM
        sublw   LOW(d'12000')
        movwf   LongMLo         ;if borrow, C = 0, so increment the subtrahend 
        btfss   STATUS, C
        incf    LongMHi
        movf    LongMHi, w
        sublw   HIGH(d'12000')
        movwf   LongMHi
    
        decf    LongD           ;Correct Degrees
    
    PosLong
        movlw   d'90'
        addwf   LongD           ;Normalise D' to 0-180
        movf    LongD, w
        movwf   ALo
        clrf    AHi
    
        movlw   d'10'
        call    DivMod          ;Mod out in A, Div out in B
        movf    BLo, W
        addlw   "A"
        movwf   Loc1
        movf    ALo, w
        addlw   "0"
        movwf   Loc3
    
        rrf     LongMHi         ;Divide by 4 to give range 0 - 2999
        rrf     LongMLo
        rrf     LongMHi
        rrf     LongMLo
        movlw   0x3F
        andwf   LongMHi
    
        movf    LongMLo, w      ;Mins * 100 / 4  DIV 125
        movwf   ALo
        movf    LongMHi, w
        movwf   AHi
        movlw   d'125'
        call    DivMod          ;Mod out in A, Div out in B
        movf    BLo, w
        addlw   "A"
        movwf   Loc5
    
              ;Recover  MOD term (scaled 0 - 124) which stays in ALo
        clrf    AHi
        bcf     STATUS, C
        rlf     ALo             ;Scale to 0 - 248
        movlw   d'25'
        call    DivMod          ;Mod out in A, Div out in B
        movf    BLo, w
        addlw   "0"
        movwf   Loc7	;Result in LongD, LongMHi, LongMLo , NEGLONG
    
    
                ;'''''''''''''''''''Now DO LAT term , LatD is already in range 0 - 90''''''''''''''''''
        btfss   NEGLAT
        goto    PosLat
        comf    LatD
        incf    LatD            ;LatD now in 2's complement +/-90
    
        movf    LatMLo, w       ;Normalise LatM = 6000 - LatM
        sublw   LOW(d'6000')
        movwf   LatMLo   
        btfss   STATUS, C       ;if borrow, C = 0, so increment the subtrahend 
        incf    LatMHi
        movf    LatMHi, w
        sublw   HIGH(d'6000')
        movwf   LatMHi
    
        decf    LatD            ;Correct the degrees
    
    PosLat
        movlw   d'90'
        addwf   LatD            ;Normalise to 0-180
        movf    LatD, w
        movwf   ALo
        clrf    AHi
    
        movlw   d'10'
        call    DivMod          ;Mod out in A, Div out in B
        movf    BLo, W
        addlw   "A"
        movwf   Loc2
        movf    ALo, w
        addlw   "0"
        movwf   Loc4
    
        bcf     STATUS, C
        rrf     LatMHi          ;Divide by 2 to give range 0 - 2999
        rrf     LatMLo
    
        movf    LatMLo, w       ;Mins * 100 / 2  DIV 125
        movwf   ALo
        movf    LatMHi, w
        movwf   AHi
        movlw   d'125'
        call    DivMod          ;Mod out in A, Div out in B
        movf    BLo, w
        addlw   "A"
        movwf   Loc6		
    
              ;Recover  MOD term (scaled 0 - 124) which stays in ALo
        clrf    AHi
        bcf     STATUS, C
        rlf     ALo             ;Scale to 0 - 248
        movlw   d'25'
        call    DivMod
        movf    BLo, w
        addlw   "0"
        movwf   Loc8	;Result in LatD, LatMHi, LatMLo , NEGLAT
    
    
    ShowLoc
        movf    Loc1, W
        call    LcdData
        movf    Loc2, W
        call    LcdData
        movf    Loc3, W
        call    LcdData
        movf    Loc4, W
        call    LcdData
        movf    Loc5, W
        call    LcdData
        movf    Loc6, W
        call    LcdData
        movf    Loc7, W
        call    LcdData
        movf    Loc8, W
        call    LcdData
      
    
        return
    Rob.

    The moment after you press "Post" is the moment you actually see the typso

  2. #2
    Join Date
    Dec 2011
    Location
    IO93ok
    Posts
    190

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

    I have made a separate switchable sub for the Big Digit clock which just uses the h, m, s, part of the gps string called alone.

    Pic of result. As near accurate to second as code allows.

    Name:  bigdigit.jpg
Views: 5538
Size:  49.3 KB
    Last edited by tasmod; - 15th April 2014 at 20:15.
    Rob.

    The moment after you press "Post" is the moment you actually see the typso

  3. #3
    Join Date
    Dec 2011
    Location
    IO93ok
    Posts
    190

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

    Darrel,

    I found this regarding the 4th pair.

    THIRD PAIR (aa-xx)
    Each field can be further divided into (24) 5 minutes (0.083333 degrees) longitudinal
    by (24) 2.5 minute (0.0416665 degrees) latitudinal zones.

    The first character encodes the longitude and the second encodes the latitude with
    letters “a” thru “x” (refer to example 3 below).

    Example 3:
    Longitude = 0.338038 {Refer to example 2}
    = 0.338038 / 0.083333
    = 4 remainder 0.004706
    = e
    (location in 5th zone)
    Latitude = 0.664048
    = 0.664048 / 0.0416665
    = 15 remainder 0.0390505
    = p
    (location in 16th zone)

    FOURTH PAIR (00-99)
    Each field can be further subdivided into (10) 30 seconds (0.008333 degrees) longitudinal
    by (10) 15 seconds (0.004166) latitudinal zones. The first character encodes the longitude
    and the second encodes the latitude with numbers “0” thru “9” (refer to example 4 below).

    Example 4:
    Longitude = 0.004706 {Refer to example 3}
    = 0.004706 / 0.008333
    = 0 remainder 0.004706
    = 0
    (location in 1st zone)
    Latitude = 0.0390505 {Refer to example 3}
    = 0.0390505 / 0.004166
    = 9 remainder 0.001556
    = 9
    (location in 10th zone)
    Rob.

    The moment after you press "Post" is the moment you actually see the typso

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959

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

    Thanks Rob, that is helpful.
    But the routines from the pearl script don't leave the variables in the right state to do the last part.

    I'm trying to recreate it in a spreadsheet to see what values the variables should have at that point.
    But finding time to look at it is difficult right now.

    Just wanted to let you know I'm still working on it.
    DT

  5. #5
    Join Date
    Jan 2012
    Location
    Grid EN19MV
    Posts
    159

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

    Quote Originally Posted by Darrel Taylor View Post
    I'm trying to recreate it in a spreadsheet to see what values the variables should have at that point.
    But finding time to look at it is difficult right now.
    Don't know if THIS PDF will help - but I was using this in my early attempts to get this figured out. It describes how to discern the 7th and 8th digits
    "I have noticed that even those who assert that everything is predestined and that
    we can change nothing about it still look both ways before they cross the street"


    -Stephen Hawking

  6. #6
    Join Date
    Dec 2011
    Location
    IO93ok
    Posts
    190

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

    Hi Darrel,

    Many thanks for this.

    I wondered about the variables. I did have a try at following the code through in the hope I could perhaps work it out.

    As a test. I changed the string to 8 characters and tried adding MH(7) ="0" + AINT/10 and MH(8)="0"+ AINT/10 in Lat and Lon routines after MH4 and MH5 as a trial to see what was displayed.

    I think the routine at 8 chrs is referencing the midi digit routine chrs as it displays custom chrs on the LCD in those positions.

    I tried repeating MH4 and 5 but renumbered, so that should give 'IO93okok' as the 7th and 8th position but again it accessed custom chrs. A puzzle for me anyway.
    Rob.

    The moment after you press "Post" is the moment you actually see the typso

  7. #7
    Join Date
    Dec 2011
    Location
    IO93ok
    Posts
    190

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

    Hi Andy,

    That's the doc I took the info post from

    Regarding working satellites, I downloaded a Maidenhead Locator App for my Android phone. Gives lots of other info too.
    Able to get 10 digit locator from the inbuilt gps on the phone.
    Rob.

    The moment after you press "Post" is the moment you actually see the typso

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 : 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