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

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,512
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    Since starting this post I have bought this type, so this is what I'm working on at the moment.
    C.
     

    Attached Files:

  2. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,319
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    hi C,
    Moved to correct Thread
    E
     
    Last edited: Oct 6, 2017
  3. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,512
    Likes:
    11
    Location:
    Dorset UK.
    Hi E, and J,
    In my program I have SPI commented out.
    On one of the programs, I am following from Chris Holden, even though he used Oshonsoft for writing the program he didn't use SPI in this case as he is moving from Oshonsoft and used 'bit banging' (whatever that is) so that he can migrate to a different system.
    See attached program: This works in Oshonsoft, although it is a bit advanced for me at the moment. I would like to simply make a mark on the screen, to get started.
    (Eric suggested using ADDRESS 0x01 as a test)
    C.
     

    Attached Files:

    Last edited: Oct 6, 2017
  4. dave

    Dave New Member

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


     
  5. camerart

    camerart Active Member

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

    Hi,
    Just watched this video, and it looks like it will get us started:
    C.
     
  6. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,512
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    Here's a program with settings as the #64 video. Also a Data analyser reading, showing everything that was recorded.
    I also checked the MISO on an oscilloscope, and even though I can't record it easily, I could see a weak reading approx 1/2V, probably what shows on the Analyser.

    There were some comments on the other SPI thread, (A program with READ in it) but it was established that there is no MOSI, so does this attached program follow the suggestions.

    If the Oshonsoft SPI doesn't work in this way, 'Bit banging' has been suggested also. Is this a good idea?
    EDIT:Above I wrote MISO, it should read MOSI.
    C.
     

    Attached Files:

    Last edited: Oct 8, 2017
  7. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

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

    Attached Files:

    Last edited: Oct 8, 2017
  8. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,380
    Likes:
    665
    Location:
    Derbyshire, UK
    As far as I'm aware none of them do?, it's a 3.3V device, and you need to take precautions using it on a 5V system.
     
  9. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,512
    Likes:
    11
    Location:
    Dorset UK.
    Hi N,
    My set-up is all 3.3V
    Thanks.
    C.
     
    • Informative Informative x 1
  10. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,512
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    Can you remind me about the simplified method later please, I would have difficulty changing for a while.
    Attached shows the digital protocol. Is the MOSI pulled up or down? The analyser appears to show '0' at MOSI. Is it the 2x1K resistors for this? (and which other 1)
    EDIT: Just tried the MOSI PIN (at the 5110 input) to check the connection, with a slow ON/OFF it shows ok on the oscilloscope.
    C.
     

    Attached Files:

    Last edited: Oct 8, 2017
  11. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,512
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    I tried a previous program with the longer version of SPI (I substituted the SPI settings) , here's an analyser read out showing MOSI working. ????
    C.
    EDIT: Channel 2 is connected to the C/D PIN on the module. As it shows the same movement as the MOSI PIN it may be some sort of echo?
     

    Attached Files:

    Last edited: Oct 9, 2017
  12. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,512
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    Is there's any possibility it could be a problem that I am using 18LF2520 and Oshonsoft only supports 18F2520?
    C.
    EDIT: Eric, Just tried your program @ #86, again no signs of life!
    I'm modifying an old circuit with an 18F2420 which Oshonsoft supports, to see if there's any difference.
     
    Last edited: Oct 9, 2017
  13. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,319
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    hi C,
    As you know, I would like to help you solve the SPI problem, but you are making it almost impossible by posting programs which are so over complicated.

    If I post a cut down diagnostic Basic SPI program for the 5110 only, will you try it and advise what you see.??

    Eric
     
  14. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,512
    Likes:
    11
    Location:
    Dorset UK.
    Hi Eric,
    I edited my last post #71 with the results of your cut down program, just as you were posting.
    I appreciate your help of course, but I am limited in my skills, and have to print everything out and comment it so I can follow, so big changes take me longer time to digest. Sorry.
    C.
     
  15. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,319
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    hi C,
    Program the 18LF2520 with this simple program.
    Connect the 5110 to the PIC pins as per the program [ no changes made ] but note that Oshonsoft SDO means MOSI .
    The LCD should display all pixels.
    The image shows that the correct data is being sent from the PIC when simulated.
    E
    A001.gif
     

    Attached Files:

  16. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,319
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    hi C,
    This is my point, it is easier and more effective to solve a projects problems in a separate diagnostic program, rather mixing it into the main program.
    Once you have debugged the program fragment and it drives the hardware, then you can start adding comments to that fragment and copy/paste into the main aprt.
    E
     
  17. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,512
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    Same result, nothing shows.
    I'll try again tomorrow and test it with the Analyser, and post the result.
    EDIT: I understand that PIC SDO-----------MODULE SDI = MOSI
    C.
     
    Last edited: Oct 9, 2017
  18. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,319
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    hi C,
    OK,
    Post your images of the SPI signals.
    I guess you have the backlite, lit on the 5110.?
    Any chance of a clear photo image of the PIC to 5110, showing the wiring.
    E
     
  19. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,380
    Likes:
    665
    Location:
    Derbyshire, UK
    The backlight is optional, they work quite well without it.
     
  20. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,319
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    I asked just in case his Contrast setting was too low for viewing in ambient light levels, having the back lite On, should just show the pixels, if they are present.
     
  21. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    270
    Likes:
    15
    Location:
    Helsinki, Finland
    No, they are identical from programming point of view.
    Check the wiring between pic and lcd.
     

Share This Page