1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

PIC plus-5110 LCD-GPS-BMP280-HMC5983

Discussion in 'Oshonsoft' started by camerart, Mar 12, 2017.

  1. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,354
    Likes:
    650
    Location:
    Ex Yorks' Hants UK
    hi C,
    This is a demo Sim version of the program.
    It takes an incoming GPS message and saves into an Array.
    The array is then parsed into the main values as Named Strings also converted to Named Single Numeric values for Maths operations.

    So to display a message on the 5110:-
    call wr_msg( x0,y0, name of the string) '

    eg: call wr_msg( 0,0, strlat) ' or if you prefer

    msg1 =strlat
    call wr_msg( 0,0, msg1)


    The delay has been finding code that will work in Oshonsoft using String and Single combinations.

    E
     

    Attached Files:

  2. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,833
    Likes:
    11
    Location:
    Dorset UK.
    Hi E, [Strange, I didn't get a notification that you had posted it!]

    Excellent!
    I'll see if I can get the 5110 working and let you know.
    Thanks.
    C.
     
  3. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,354
    Likes:
    650
    Location:
    Ex Yorks' Hants UK
    hi C,
    I see that you are using the 18F4520 with the internal 8MHz clock.??
    If so, you could easily enable the internal * 4 PLL and run the PIC at 32MHz, this would give you more time to do complex maths routines.

    Let me know and I will edit a program for you

    E
     
  4. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10
  5. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,833
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    I'll to set the *4PLL first and if I can I'll let you know.
    My PCB has provision for a XTL. I think the fastest allowed is 20mHz. Would it be better to use a 16mHz being a division of 32, OR simply use the INT OSC?
    C.
     
  6. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,354
    Likes:
    650
    Location:
    Ex Yorks' Hants UK
    hi,
    Using the Internal Osc at 8MHz with the PLL enabled would give 32MHz operation for zero cost and reduce the PCB tracks.
    Use the Oshonsoft Config and select INTOSC as shown in this image.
    OSCCON = %01110010 'internal 8Mhz clock
    OSCTUNE.PLLEN = 1 '*4 PLL enabled so Fosc == 32MHZ

    E.
    BTW I see that you are getting very close to using all your GPR space.!!!

    This Basic cammy3.bas is a cleaned up version, note the GPR usage.

    EDIT: also has the TIME formatted,
     

    Attached Files:

    Last edited: Dec 30, 2017
  7. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,833
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    I think the X4 is set correctly.

    What is using the GPR space?

    "Has the TIME formatted?" I'm not sure what that means, but here is a Variable TEXT showing 'strtim' Is this it?

    C.
     

    Attached Files:

  8. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10
  9. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,354
    Likes:
    650
    Location:
    Ex Yorks' Hants UK
    hi,
    The 'te:st:st' is the Time taken from the GPS string eg: 123456 , formatted would be 12:34:56 .
    In your Test Message, replace the word 'test' with a Time value HHMMSS .

    GPR are the PICs General Purpose Ram locations.
    When you DIM a parameter as a String, the Program allocates that String as Bytes in GPR's, so they are not available for use by the rest of the Program.
    The 18F4520 has only 1536 Bytes of GPR space,
    In your original Program you have only 61 Bytes left.!

    If the next section of Code you write within that Program uses more than 61 Bytes for DIM's etc... the Program will not compile.

    E
     
  10. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,833
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    Don't get 12V mixed up with 5V! Just 'popped' my GPS:arghh: It's probably the regulator, so I may be able to fix it.

    At one point I had "LAT" and the LAT STRING showing on the 5110. I can see the NMEA going into RX and out of the TX on the 18LF4520, with TERATERM (putty) So we're pretty close.

    It's possible that even though the GPS looks like it working ok, it could be because it's inside and cloudy.

    C.
     
  11. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,833
    Likes:
    11
    Location:
    Dorset UK.
    HI,
    Success.

    Here is a photo (Qualiteee) of the 5110 showing TIME and the time updationg ok. [No seconds!]

    Here is the program:

    I changed the GPS to an NEO-6 This isn't as sensitive as the 8, and I found that because it is in poor conditions, the NMEA sentences aren't being gleaned reliably, so I found one that always seems to show the TIME, so the 'verify' letter is 'C instead of G.

    C.
     

    Attached Files:

  12. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,833
    Likes:
    11
    Location:
    Dorset UK.
    HAPPY NEW YEAR

    The program at #249 used NMEA sentence $GPRMC, because I was unable to get $GPGGA to work. I tried many combinations of letters for the selection. Also I temporarily tried removing the 4x 8mHz selection, and erase PIC memory before programming.

    Here are two jpgs from the Teraterm (Putty) readout 1/ Just before the strtim shows after TIME, and 2/ Once the strtim shows after TIME on the 5110. From this I can't see why only RMC works and not GGA?? [It works in SIM]

    C.
     

    Attached Files:

  13. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,354
    Likes:
    650
    Location:
    Ex Yorks' Hants UK
    hi C,
    The GPGGA time looks wrong to me.??
    Are sure it has the 123459.00
    E

    'await NEO GPS RXD
    get_neo: ''$GPGGA,123459.00,5001.00000,N,00059.00000,W,1,04,1.80,1.2,M,47.7,M,,*7F?
    '$GPRMC,123459.00,5001.00000,N,00059.00000,W,1,04,1.80,1.2,M,47.7,M,,*7F? NOTE DIFFERENT SENTENCEXXXXXXX

    My example.
    '$GPGGA,123519,5050.198,N,00106.769,W,1,08,0.9,123.4,M,46.9,M,,*47?
     
  14. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,833
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    I have two files of NMEA information, one has the ??????.00, and the other only has ??????,

    As shown on the live Teraterm readings from the GPS, there is ??????.11 which changes to .00 within a second. The two live jpgs show just before the 5110 shows the updating time, and the second shows at the time udating time shows on the 5110, when using RMC only. To me they both look very similar, regarding TIME

    I'm not sure what the [.00] are for except split second timing perhaps.

    C.
     
    Last edited: Jan 2, 2018
  15. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,354
    Likes:
    650
    Location:
    Ex Yorks' Hants UK
    hi C,
    Checking on-line I get this
    $GPGGA,HHMMSS.SS,DDMM.MMMMM,K,DDDMM.MMMMM,L,N,QQ,PP.P,AAAA.AA,M,±XX.XX,M,SSS,RRRR*CC<CR><LF>

    https://hemispheregnss.com/gnssreference/GPGGA.htm

    So for the time HHMMSS.SS
    Leftstr(msg,2)+":" + MidStr(msg,3,2)+":" + MidStr(msg,5,2)
    == HH:MM:SS

    E

    EDIT:
    Please post a complete GPS msg, $GPGGA
     
  16. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,833
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    P.S:
    I added a LED toggle after: [If str1(5) = 0x47 Then 'G'] With RMC it toggles with GGA it doesn't toggle.
    C.
     
  17. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,833
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    I edited a '1' to make it compile, is this correct?

    strtim = Leftstr(msg1,2)+":" + MidStr(msg1,3,2)+":" + MidStr(msg1,5,2)

    This didn't work.

    C.
     
  18. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,833
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    Ive tried lots of letter combinations in the:
    'If str1(4) = 0x52 Then 'R'
    If str1(5) = 0x47 Then 'G'
    If str1(6) = 0x41 Then 'A' LOOP.

    Any 1 letter or combinations of letters in the RMC sentence works ok. Any combination in the GGA sentence doen't work. It appears that it isn't recognising certain letters.

    As shown in the JPGs as soon as the GPS 'sees' the time in RMC it prints it.

    If I try If str1(6) = 0x41 Then 'A' then 'A' only is shown after the "TIME" In other combinations, I get different odd digits, but nothing in GGA.

    C.
     
  19. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,354
    Likes:
    650
    Location:
    Ex Yorks' Hants UK
    hi C,
    Got your PM OK.
    Please post your problem basic, I have modified a BB to use a 18F4520 and a 9110 LCD, so that I can try your prog.

    E
    BTW: I use Termite program for serial.
     
  20. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,833
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    Here is the latest program. As mentioned it simulates ok. When $GPRMC is used, it now shows HH:MM:and SS all updating with GPS input.

    I also have Termite, but since making macros for the Tracker, I now use Teraterm.

    C.
     

    Attached Files:

  21. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,354
    Likes:
    650
    Location:
    Ex Yorks' Hants UK
    hi C,
    Downloaded, will reply tomorrow.
    E
     
  22. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,833
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    Here is the latest program. As mentioned it simulates ok. When $GPRMC is used, it now shows HH:MM:and SS all updating with GPS input.

    I also have Termite, but since making macros for the Tracker, I now use Teraterm.

    C.
    Hi E,

    Ok.

    I've had some programming tips regarding long programs by a mate. He says he uses modules for each section of a program. I've seen this with Ardiuinos, but never quite understood it. Since you added an INCLUDE for font1, would it be a good idea to have each of the sensors etc, as INCLUDES also? i,e, GPS,,,,,Barometer,,,Compass etc.

    C.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice