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
    May 2013
    Location
    australia
    Posts
    2,653

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

    The project as i have it in mind need to have an SD in order to store the Data from GPS Nmea.

    I found out that only a microcontroller with 48mhz supports something like that
    where did you find that , its not what I understand the case to be. are you confusing usb support for sd card support ?

    May i use the same speed for All the peripherals SD, Ulcd, GPS? Or do i need to specify different one for each module?
    unless you specify what spi rate the sd card supports and what sd card system you intend to use [sdfs3 ? fat16? fat 32?] along with
    the baud rate used for the serial I/f's and your osc speed it would be guesswork only.


    Could You help me and clarity what i need for each GPS, SD, Ulcd?
    not really you need to supply a lot more info

    i need to communicate Serial with GPS module and then i need to store the raw Nmea Data to SD and display what i need from the Nmea protocols to display
    compared to PIC18F4550 or PIC18F2550 a pic 18f26k22 has two times the flash memory , sram ,spi ports, eusarts has more timers and can run at 64 MHz . I think it would be a good fit
    for that sort of project
    Last edited by richard; - 21st June 2018 at 01:49.
    Warning I'm not a teacher

  2. #2
    Join Date
    Oct 2010
    Posts
    413

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

    The project as i have it in mind need to have an SD in order to store the Data from GPS Nmea.
    I found out that only a microcontroller with 48mhz supports something like that

    where did you find that , its not what I understand the case to be. are you confusing usb support for sd card support ?
    Oops well i'm wrong, base on the following and FAT16 it is not necessary.

    http://melabs.com/samples/PBP-mixed/sdfs3.htm

    I was confused with this link as they specify high MCU speed for FAT32

    http://www.picbasic.co.uk/forum/showthread.php?t=18370

    May i use the same speed for All the peripherals SD, Ulcd, GPS? Or do i need to specify different one for each module?

    unless you specify what spi rate the sd card supports and what sd card system you intend to use [sdfs3 ? fat16? fat 32?] along with
    the baud rate used for the serial I/f's and your osc speed it would be guesswork only.
    Regarding Serial speed baudrate:

    1) For GPS, i have tried to send the "right" command for increase the baudrate, with no sucess....it seems that the GPS receives the command but does not like it :P.
    2) ulcd seems to work with higher baud rate, but i need to configure the delay times for each command. I havent really understand how to increase the baudrate corresponding to delays. The ulcd needs some delay time to accept the command and display it properly. Is it right?
    3) SD card with FAT 16 (when i reach that point we will discuss further). At the moment it is clear that up to 2GB fat 16 is required and is not necessary high MCU speed. But i will try to get the maximum from the PIC.

    Could You help me and clarity what i need for each GPS, SD, Ulcd?

    not really you need to supply a lot more info
    I understand that im not clear, as i really wont have the knowledge to explain it. Actually im confused with MCU speed, which is the speed that PIC running each command and calculate each command, with the speed of the communication ports.

    I guess that a higher MCU speed is better in order to calculate faster the information from the peripherals. I know my questions are too basic, and believe me i start reading all these stuff in order to understand better. I feel that you cannot help me i i dont understand these basic processes of the PIC.

    So i started to read about MCU speed, clock and counter.

    i need to communicate Serial with GPS module and then i need to store the raw Nmea Data to SD and display what i need from the Nmea protocols to display.

    compared to PIC18F4550 or PIC18F2550 a pic 18f26k22 has two times the flash memory , sram ,spi ports, eusarts has more timers and can run at 64 MHz . I think it would be a good fit
    for that sort of project

    Really appreciate your advice....PIC18LF26K22 or PIC18LF4550 fits to my project better because i would like to use a single 3.7V Lipo battery not more than 800-1000mha. The Final circuit will have:

    1. PIC18LF26K22 or PIC18LF4550
    2. GPS module for all the info....Date, Time, Speed, Coordinates etc.
    3. SD for storage the raw NMEA Data
    4. A display only for the on the go use. For battery saving, a ulcd will not be used normally. SD will keep the info.

    Many thanks once again.

    I would like to apologize for "breaking" the original TOPIC. Is it possible an Admin to move all the discussion i have started from POST #66, in a NEW thread? Thanks.....
    Last edited by astanapane; - 21st June 2018 at 07:45.

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

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

    1) For GPS, i have tried to send the "right" command for increase the baudrate, with no sucess....it seems that the GPS receives the command but does not like it :P.
    the data sheet for the module should resolve that issue

    2) ulcd seems to work with higher baud rate, but i need to configure the delay times for each command. I havent really understand how to increase the baudrate corresponding to delays. The ulcd needs some delay time to accept the command and display it properly. Is it right?
    the ulcd data sheet should give you that information

    3) SD card with FAT 16 (when i reach that point we will discuss further). At the moment it is clear that up to 2GB fat 16 is required and is not necessary high MCU speed. But i will try to get the maximum from the PIC.
    since sd cards use spi [a synchronous data transfer method] cpu osc speed is largely irrelevant as long as it not too fast for the card/mssp combination
    when you use the mssp module there are several spi clock options.


    a PIC18LF4550 is in my opinion not a good choice , the project calls for a chip with two eusarts.


    I would like to apologize for "breaking" the original TOPIC. Is it possible an Admin to move all the discussion i have started from POST #66, in a NEW thread? Thanks.....
    I agree, as I have said from the start what you are asking has no relevance to maidenhead in any way shape or form
    Warning I'm not a teacher

  4. #4
    Join Date
    Oct 2010
    Posts
    413

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

    Hi Richard,

    thanks once again for your time and help. You are right regarding the 18LF4550. It is not for my application.

  5. #5
    Join Date
    Oct 2010
    Posts
    413

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

    The leap years, month and days are fixed. Please let me know if you find any mistake on this.

    Is there any way now to test the leap year?

    Code:
    arraywrite ndays,13,NDAY,[0,31,28,31,30,31,30,31,31,30,31,30,31]
    
    if ((year//4 = 0) and (year//400 != 0)) then    'check the leap year
     ndays[2] = 29                                  'then February has 29 days
       else                                         
     ndays[2] = 28                                  'else has 28 days
     endif
     hh = hh + 3                                    'the Hour from GPS is UTC so for our country in Greece we add +3
     if hh>23 then                                  'if the hh+3 hour is greater than 23 (23:00) then
     day = day + 1                                  'we check the day added is true
     hh = hh//24                                    'but the hour not exceed the 24 so go to 00:00
        if (day > ndays[month]) then
     month = month + 1
     day = 1 
            if (month > 12) then
     year = year + 1
     month = 1
            endif
         endif
     endif
    
    
    NDAY:
    ndays[0] = 0
    ndays[1] = 31       'January
    ndays[2] = 28       'February
    ndays[3] = 31       'March
    ndays[4] = 30       'April
    ndays[5] = 31       'May
    ndays[6] = 30       'June
    ndays[7] = 31       'July
    ndays[8] = 31       'August
    ndays[9] = 30       'September
    ndays[10] = 31      'October
    ndays[11] = 30      'November
    ndays[12] = 31      'December
    Apart from that i have found the attached file for the PICKIT2. Do you have any reference on that?
    Attached Files Attached Files

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

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

    if ((year//4 = 0) and (year//400 != 0)) then 'check the leap year
    ndays[2] = 29 'then February has 29 days
    else
    ndays[2] = 28 'else has 28 days
    endif
    the above code only needs to run if month = 2

    Is there any way now to test the leap year?
    only the obvious , send it a few go nogo date strings and check the result
    Warning I'm not a teacher

  7. #7
    Join Date
    Feb 2013
    Location
    Quebec, Canada
    Posts
    67

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

    Quote Originally Posted by astanapane View Post
    1) For GPS, i have tried to send the "right" command for increase the baudrate, with no sucess....it seems that the GPS receives the command but does not like it :P.
    Some modules requires you to send a checksum at the end of the command. Here for a NEO-6M GPS Module:

    Code:
    'Turn off RMC - Recommended minimum specific GPS/Transit data
    hserout2 ["$PUBX,40,RMC,0,0,0,0,0,0*47", 13, 10]
    pause 500
    
    'Turn off GSA - GPS DOP and active satellites
    hserout2 ["$PUBX,40,GSA,0,0,0,0,0,0*4E", 13, 10]
    pause 500
    
    'Turn off GSV - GPS Satellites in view
    hserout2 ["$PUBX,40,GSV,0,0,0,0,0,0*59", 13, 10]
    pause 500
    
    'Turn off GLL - Geographic position, latitude / longitude
    hserout2 ["$PUBX,40,GLL,0,0,0,0,0,0*5C", 13, 10]
    pause 500
    
    'Turn on  ZDA
    hserout2 ["$PUBX,40,ZDA,0,1,0,0,0,0*45", 13, 10]
    pause 500
    Do you really need to change the baud rate? If you are just logging then 9600 is more than enough.

    FYI, here is my source for most of the NMEA sequences: http://aprs.gids.nl/nmea/

  8. #8
    Join Date
    Oct 2010
    Posts
    413

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

    Quote Originally Posted by MichelJasmin View Post
    Some modules requires you to send a checksum at the end of the command. Here for a NEO-6M GPS Module:

    Code:
    'Turn off RMC - Recommended minimum specific GPS/Transit data
    hserout2 ["$PUBX,40,RMC,0,0,0,0,0,0*47", 13, 10]
    pause 500
    
    'Turn off GSA - GPS DOP and active satellites
    hserout2 ["$PUBX,40,GSA,0,0,0,0,0,0*4E", 13, 10]
    pause 500
    
    'Turn off GSV - GPS Satellites in view
    hserout2 ["$PUBX,40,GSV,0,0,0,0,0,0*59", 13, 10]
    pause 500
    
    'Turn off GLL - Geographic position, latitude / longitude
    hserout2 ["$PUBX,40,GLL,0,0,0,0,0,0*5C", 13, 10]
    pause 500
    
    'Turn on  ZDA
    hserout2 ["$PUBX,40,ZDA,0,1,0,0,0,0*45", 13, 10]
    pause 500
    Do you really need to change the baud rate? If you are just logging then 9600 is more than enough.

    FYI, here is my source for most of the NMEA sequences: http://aprs.gids.nl/nmea/
    Yep, thanks a lot.....i've seen all that, for my case i have the MKT 3333 and 3339 module. Which have the following

    Code:
    'serout2 gps_rx,84, ["$PMTK314,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0*0D",13,10]      
    'serout2 gps_rx,84, ["$PMTK251,57600*2C",13,10]      ' baudrate, check MTK manual configuration
    'serout2 gps_rx,84, ["$PMTK220,200*2C",13,10]        ' 200(millisecond)=0.2(sec)-->1/0.2 pps=5 Hz
    The problem is that it does not work for some reason.

    I think i need to use the HSEROUT2 instead of SEROUT2. I'm confused at this point.

    I get online help for checksum from this site

    http://www.hhhh.org/wiml/proj/nmeaxor.html

  9. #9
    Join Date
    Oct 2010
    Posts
    413

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

    Ok i have right now:

    1. TX port which is connected to ulcd. Baudrate : 38400

    Example code:
    Code:
    pause 2000 
    serout2 LCD,6,[$55]      ' uOLED Initialize this is the 'U' character of autoband rate to LCD 
    pause 500         
    serout2 LCD,6,[$56,$01]  ' this is the Version info
    pause 500
    serout2 LCD,6,[$45]      ' clear the lcd
    pause 100

    2. RX port from GPS module. Baudrate : 9600

    Example code:
    Code:
    ;serin2  gps_tx,84,timeout,lostcable,[wait("$GNRMC"),_          ;we wait for $GNRMC
    The GPS at the moment is locked at 9600. Via the serial terminal GPS software i set it to 19200 and accepts the command. But only for the time the module is connected to the power. When we disconnect the power from GPS, the default commands are set.

    I dont mind for that right now as i found out that i can communicate with PIC at 19200 with GPS and receive the commands on the display.

    The setting for the Clock Speed is 8Mhz.

    Now if i increase the speed of the baudrate with GPS and goes up to 38400 then i cannot display anything.

    I did an experiment and added an external Crystal of 16 Mhz. For my surprise values presented on the display.

    I have a question now. something i dont like with the following code:

    Code:
    @ ERRORLEVEL -306 ; this command prevents the compiler to give you a notice of
                      ; crossing page boundary - make sure bits are set 
    #CONFIG
        __config _CONFIG1, _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF
    #ENDCONFIG
    
    Include "MODEDEFS.BAS"
    DEFINE OSC 8
    OSCCON=%01110000     '8 Mhz
    Why should i need to add both of the lines?

    Code:
    DEFINE OSC 8
    OSCCON=%01110000     '8 Mhz
    In case i remove any of these, it compiles ok, but program is not working.

    I need to specify that this is an internal OSC, but above in the configuration bits i have put _HS_OSC (if i remember that must be set from the manual)

    Is it right?

    thanks a lot for your help once again.

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

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

    Why should i need to add both of the lines?
    OSCCON=%01110000 '8 Mhz ;sets the actual fosc speed




    DEFINE OSC 8 ; tells the compiler what fosc speed to base timing calculation on


    software timed serout2 @ > 38400 baud with fosc < 8mhz may have an unacceptable error rate
    Warning I'm not a teacher

  11. #11
    Join Date
    Oct 2010
    Posts
    413

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

    Quote Originally Posted by richard View Post
    OSCCON=%01110000 '8 Mhz ;sets the actual fosc speed




    DEFINE OSC 8 ; tells the compiler what fosc speed to base timing calculation on


    software timed serout2 @ > 38400 baud with fosc < 8mhz may have an unacceptable error rate
    I understood from the experiment that something didnt go well when i increased the baudrate at 38400 with the 8Mhz internal speed.

    Is there any equation or a factor that calculates this corresponding.

    thanks a lot.

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