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.

    Complete working prototype system

    Name:  gpslcd.jpg
Views: 18325
Size:  62.9 KB

    Rockwell GPS Module on right. PLL and TCXO board on left. TCXO is small vertical board top left. Small board at top with all wires is 7805 5v reg board.

    Name:  gpsdo.jpg
Views: 18426
Size:  56.6 KB

    Rear of LCD showing piggyback decoder.

    Name:  llcdrear.jpg
Views: 18445
Size:  29.0 KB
    Last edited by tasmod; - 3rd April 2014 at 12:04.
    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.

    Darrel,

    Don't know if you are still reading this thread.

    I wondered how difficult it would be to add the final two numerical digits of the locator so that it is the full 8 digit string.

    I nearly destroyed the prototype when I took it out in the car to test the locator code. The car voltage meant the regulator board became really hot, I was afraid it would fail.

    Thanks,
    Rob.

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

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

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

    The code was based on the pearl script on the Wikipedia page, which only shows how to get 6 digits.

    Do you know of somewhere that shows how to get the last two digits?
    DT

  4. #4
    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

  5. #5
    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: 18285
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

  6. #6
    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

  7. #7
    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

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