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


Results 1 to 40 of 126

Threaded View

  1. #34
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,531

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

    Hi Rob,
    I haven't been following this thread in detail so I apolgize if I'm suggesting something that's already been covered or isn't doable for whatever reason.

    Looking at the code you posted, and as you mentioned, you spend quite a bit of time in the ISR. I have two questions/suggestions.
    A) Why do you need to reload the custom characters each time? Wouldn't it be better to load them once at startup?
    B) Can't you simply set a flag in the ISR (ie UpdateDisplay = 1) which you then poll in the main loop? If the flag is set you update the display and reset the flag.

    Obviously there must be enough clock cycles between interrupts to do whatever needs to be done - no matter "where" it's being done (inside or out of the ISR).

    Doing (B) above you basically can't have the HSERIN statement within the main loop as it will "block" the processor for up to TimeOut ms (2000 in the code as posted). What you'd need to do is either introduce UART interrupt or simply poll the UART RX interrupt flag within the mainloop (provided the mainloop is "tight" enough to not overflow the UART receive buffer (2 bytes).

    As I see it at the moment, the code reads the gps string, then parses it,
    Yes and no. It doesn't read, then parses it. HSERIN is parsing the string as the bytes comes in, one by one. If it didn't do that you'd have to have a recieve buffer as big as the complete NMEA string. But again, the code in your ISR takes considerable amount of time and it's quite possible that if an interrupt occurs in the middle of the HSERIN statment (quite possible) the ISR is stealing too much time so the the receive buffer (2 bytes) overruns and HSERIN "gets lost".

    At 4800 baud each byte is a about 2ms long so if your ISR takes more than 4ms to execute it will most definitely cause issues for the HSERIN. Seeing all those LCDOUT statements within the ISR and the subroutines it calls makes me think your ISR runs way up into the tens of ms.

    /Henrik.
    Last edited by HenrikOlsson; - 29th April 2014 at 21:00.

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