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 48x84 LCD-GPS

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

  1. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,312
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    hi C,

    It works for me, note one point you were not clearing msg1 at the correct location.

    Hserout "TIME=", strtim, " lat=", #sinlat, " lon=", #sinlong, " alt=", #sinalt, CrLf
    msg1 = ""
    '###########################################################################
    msg1 = strtim
    msg1 = "TIME " + msg1
    Call wr_msg(0, 0, msg1)
    '############################################################################

    msg1 = "" '+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Goto get_neo
    End
     

    Attached Files:

  2. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,497
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    Do you have a live GPS to inject the NMEA?

    I get the same result as you with simulation and injecting NMEA using a Terminal, but not with a live GPS.

    I tried logging the live GPS NMEA and ran it as a Terminal Macro, which also worked and showed updating time.

    So it appears to be some difference between how the GPS and the Terminal transmits DATA.

    C.
     
  3. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,312
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    hi C,
    I have programmed a PIC with your program [ added a ':' font to the font1.bas] it works OK with Termite and TeraTerm, but I do not have my NEO set up for live GPS data.
    E
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,497
    Likes:
    11
    Location:
    Dorset UK.

    Hi E,
    I'll look at them the best I can with an Oscilloscope to see if i can spot any differences.

    Using the Terminal, try this text. This works ok, with the minimum of information.

    C.
     

    Attached Files:

  6. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,312
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    Hi C,
    I have finally found a NEO I bought about a year ago.
    I have it outputting all the messages, do you have a block of code that I can use to select only the GPGGA string.
    E
    A004.gif
     
  7. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,312
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    hi C,
    This is one problem.
    The Serial out looks OK.
    Goto get_msg
    If rxi < 60 Then 'invalid msg
    msg1 = "" '''''''''''''''''''''''''''''''''''' ' the msg must be cleared if too short.
    Goto get_neo
    Endif


    E
    Will continue testing


    EDIT:
    Changing Time now showing OK on the LCD display.
     
  8. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,312
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    hi C,
    This basic displays Time/Lat/Long/Alt on the LCD and serial out, running from a NEO 6M module.
    It is running at 32MHz, I have also modified the code slightly [ ''+++++++++++++ ]
    Works fine , give it a try.
    NOTE: set the SPI pins back to your settings

    E
     

    Attached Files:

    Last edited: Jan 3, 2018
  9. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,497
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    Found the NEO, just where you left it;)
    I don't think I have any code for separating GPGGA. I usually edit a page on the odd occasions I need to.
    C.
     
  10. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,312
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    hi C,
    The NEO was still in its original wrapper, in a 'safe' place...:banghead:

    The neo3V.bas is able to accept all the data msg strings from the NEO without any problems and extract $GPGGA msg.
    Give it a go and let me know if you want any changes.

    E
    BTW: I deleted the GPS clip of the NEO data, I don't want the whole Planet to know where I live.
    E
     
  11. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,497
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    I tried the eg_neoV3 , with changed SPI, but it didn't work, because I found it very difficult to proof read it without it turning into a bag of spaghetti. It will take me some time.

    I tried [msg1 = ""] after [If rxi < 60 Then] but didn't work so:

    In the mean time, I have changed
    'If str1(5) = 0x47 Then 'G' str1 array ###### TEMP CHANGE #####################
    If str1(6) = 0x43 Then 'C' str1 array
    which now shows TIME and time updating.
    and bearing in mind that as I will be using a barometer/ALT module, perhaps the more reliable $GPRMC sentence will be ok.

    I'll slowly change each new section over, while verifying each time, till it all works.

    I contacted UBLOX tech support and asked then if they could shed any light on the subject, but they couldn't understand the question:confused:

    [Off to paint the bathroom which was plastered about 6 months ago]

    EDIT: I'm not sure which version of 184520 you are using, but I wonder if using 18LF4520 has any bearing on the problem?

    C.
     
    Last edited: Jan 4, 2018
  12. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,312
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    hi C,
    That program is running fine, not missing any data.
    LCD and Serial out.
    Its a 40pin DIL 18F4520.

    Are you sure PIC pins are set for I/O as required.???

    E

    EDIT:
    Do you have a clear image you could post.??? [ While the paint is drying.;)]
     
    Last edited: Jan 4, 2018
  13. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,312
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    hi C,
    Rewired my project board PIC's, SPI pins, Rst,Mode etc, to match your connections, it works fine.
    E
     
  14. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,497
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    Could you post your latest program with SPI the same as mine please? I got mixed up swapping over. [Probably had painting the bathroom in my mind]

    Bear in mind that using the RMC sentence is ok, does this prove the IN/OUTS are ok?

    I tried the UBLOX forum, and reveicved this reply:

    "Does the PIC use a software UART implementation?

    Check the bit timing of the data, likely to be tightly packed. So very little slack time between bytes."

    C.
     
  15. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,312
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    Hi C,
    Attached Cam_neoV3.bas [using your pin out]

    We are using the PIC's hardware port.
    E
     

    Attached Files:

  16. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,497
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    [One coat of paint in the bathroom]

    Hardware port not UART, ok.

    I compiled it and it works.

    I compared your HEX file with mine and apart from the first 30 ish lines, the other 900 are completely different and mine is 200 lines longer?. Is this expected?

    I noticed that as it searched for a signal, and the sentences got longer, as soon as the TIME filled up, it told the time, and the sentence was 40 digits and commas.

    EDIT: What was the problem that caused it not to work?

    Thanks.

    C.
     
    Last edited: Jan 4, 2018
  17. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,312
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    Hi C,
    Ref post #261 & #266.

    Are you saying when you compile the Basic program I posted, the hex file 200 lines longer than mine..???

    E
    BTW the UART is the hardware port.

    Examples of a Software UART

    DEFINE SEROUT_DELAYUS = 5000
    SEROUT PORTC.6, 1200, "Hello world!", CrLf
    DIM I AS BYTE loop:
    SERIN PORTC.7, 9600, I
    SEROUT PORTC.6, 9600, "Number: ", #I, CrLf
    GOTO loop
     
  18. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,497
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,

    Looking at #266. How does the program get to 'If rxi < 60' ? To me it looks as though the it would jump over it. [I'll look again tomorrow]

    Here's the HEX I compiled: Both program the same result.

    C.
     

    Attached Files:

  19. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,312
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    hi C,
    If rxi < 60' ? ,' action
    If length less than 60 then
    'its a corrupt msg so
    sdstr="" ' clear the corrupt msg from the buffer
    then got back to the start of NEO and restart looking for the '$'
    goto get_neo

    The reason for the Hex file size difference is the font1.bas.
    In my version I have dropped the Big fonts and one or to others, so the overall file size is shorter.

    What is the next stage in the project.?
    E
     
  20. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,497
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    I noticed that 'time' was updating on the 5110 when the lines on the terminal showed they were about 40 long, and when I looked at line 'If rxi < 60' the program appears to jump over it.

    I'll shorten my font1 also and call it fontsml, if that's ok. Or you can post yours please.

    Having being introduced to 'INCLUDES' by your with font1, I think it's a good idea to use them for different modules if you think it's a good idea. So 'GPS', perhaps 5110 etc then each module will hopefully be separated and be more manageable.

    Perhaps a bit ambitious, but I hope to add a barometer module (BMP280) for ALT, a compass ( LSM303) and a radio (sx1278). I hope this interests you, as I expect it to take me decades if I'm on my own:angelic:

    [Bathroom last coat]

    C.
     

    Attached Files:

  21. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,497
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    I've had a go at making an INCLUDE also shortening the FONT file. Does this look ok?
    C.
     

    Attached Files:

Share This Page