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,511
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    I had to divert my concentrations to house work over the summer, and now it's getting dark, I'm re-looking at electronic projects again.
    Using Oshonsoft, I'm trying to get 5110 LCDs to work.
    For those who know, it doesn't appear too difficult, but back to me!
    I've seen programs with various PICs so I don't think it matter too much, I'm going to start with 18LF2520 and the program on #32.
    I doubt it will simulate as it is 48x84 and I don't see one in the tools list.
    If anyone could skim through the program;) and see if you can spot obvious errors please plet me know.
    Cheers, Camerart.
     
  2. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,511
    Likes:
    11
    Location:
    Dorset UK.
  3. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    270
    Likes:
    15
    Location:
    Helsinki, Finland
  4. dave

    Dave New Member

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


     
  5. camerart

    camerart Active Member

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

    Hi J,
    Thanks.
    C.
    EDIT: Further reading found this: https://www.engr.colostate.edu/ECE251/Labs/Lab9.pdf
    If you search for 'Data/Command' there is a nice explanation, but no reference to any special connection, so I wonder if any digital pin could be used?
     
    Last edited: Oct 1, 2017
  6. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    270
    Likes:
    15
    Location:
    Helsinki, Finland
    Any pin, that can be used as output, is ok.
     
  7. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,511
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    Ok on the PIN outputs, thanks.
    I have a problem with the circuit! It is a copy from a previous circuit.
    I have a simple test program on the PIC with LED flashes at the start. This works on the previous circuit.
    The PIC programs ok, and there is a 'flashing' voltage at the LED PINs app 1V. If I short across from the +v PIN (3.3V) the LEDs light ok.
    I notice that when one LED PIN is high, the other LED PIN shows some movement.
    Any ideas?
    HERE's the program:
    '18lf2520 8mHz INT 5110 021017 1221
    'Define SIMULATION_WAITMS_VALUE = 1 'Comment in for SIM out for PIC
    Define CLOCK_FREQUENCY = 8
    Define SINGLE_DECIMAL_PLACES = 2
    Define CONFIG1L = 0x00
    Define CONFIG1H = 0x08 'INT OSC
    Define CONFIG2L = 0x1e
    Define CONFIG2H = 0x00
    Define CONFIG3L = 0x00
    Define CONFIG3H = 0x80
    Define CONFIG4L = 0x80 'Set for HVP
    Define CONFIG4H = 0x00
    Define CONFIG5L = 0x0f
    Define CONFIG5H = 0xc0
    Define CONFIG6L = 0x0f
    Define CONFIG6H = 0xe0
    Define CONFIG7L = 0x0f
    Define CONFIG7H = 0x40
    AllDigital
    OSCCON = %01110010 'internal 8Mhz clock
    'SET PIN IN/OUT
    TRISA = %00000001 'IN/OUT 0=Button
    TRISB = %00000000
    TRISC = %00010001 'RC4 SDI
    'SET BITS ON/OFF
    PORTA = %00000000 'ON/OFF
    PORTB = %00000000
    PORTC = %00000000
    PORTE = %00001000 'POSS MCLR RE3
    Symbol rstbutton = PORTE.3 '???????????????????????
    Symbol button = PORTA.0
    Symbol yled = PORTC.1
    Symbol rled = PORTC.2
    'Symbol cs = PORTB.0
    'Symbol sck = PORTC.3
    'Symbol sdi = PORTC.4 'MISO
    'Symbol sdo = PORTC.5 'MOSI
    'Symbol d102data = PORTA.2
    start:
    rled = 1
    WaitMs 1000
    rled = 0
    WaitMs 1000
    yled = 1
    WaitMs 1000
    yled = 0
    WaitMs 1000
    Goto start


    C.
     
  8. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,319
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    Hi C,
    Please define 'movement'?
    E
     
  9. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,511
    Likes:
    11
    Location:
    Dorset UK.
    C.
    Hi E,
    I was watching an oscilloscope. Connected to the actual LED PIN, showed app 1V, but also had a 'shadow' 1/2V as the other PIN 'flashed'.
    C.
     
  10. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    270
    Likes:
    15
    Location:
    Helsinki, Finland
    Do you have current limiting resistors with the leds?
    In #46 you shorted a led to 3.3V supply.
    Without resistor the led might have been destroyed.
     
  11. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,319
    Likes:
    649
    Location:
    Ex Yorks' Hants UK
    Morning C,
    I have never seen a 1V drop LED.? unless you mean at the junction of output pin and the series limiting resistor.?
    Most PIC's state an absolute maximum output current of ~25mA for any one pin, but a group of output pins loaded must not exceed the max output current specified for the PIC.

    E
     
  12. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,511
    Likes:
    11
    Location:
    Dorset UK.
    Hi J,
    Sorry, my poor explanation! I should have said, there are two LED PINS both have limiting resistors (330ohm) not sure if this is correct, but it works on the first circuit ok. If I short the 3.3V to any of the LED PINS then they both light ok.
    C.
     
  13. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,511
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    Just to clarify: Each of the two LEDs should flash alternatively, for one second. At each PIN it should show 3.3V. When connected to an oscilloscope, each shows a 1V movement as that LED PIN is high, but also show 1/2 volt as the other LED PIN is high.

    To me it seems like there is some shorting, and I did have problems with the 'not so new' solder paste I used, as there was a short under one of the resistors earlier. I'll concentrate on this next.
    Note: I'm using surface mount components.
    C.
     
  14. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,511
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    Update: I've just been checking resistances around the circuit, comparing with a working similar circuit. The working circuit show most PINs have 10ish Mohms, but they show Kohms on the none working circuit, so it appears there is some shorting. I'll sort this out.
    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,
    Ensure that your power supply is well decoupled and is able to supply/maintain the voltage/current to the switched load.
    Scope the PIC's Vdd pin while the program is running, it should be 'clean' and stable
    Clip the scopes 0V lead close to the PIC when scoping around the PIC.

    E
     
  16. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,511
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    I use batteries for this, as it's low Current, and I've got used to when the batteries need charging.
    I use coax leads on my Oscilloscope, so the 0V lead is forked from the contact lead.
    I removed the PIC and there was quite a mess under it where the solder paste had spread. Once cleaned and re-soldered it all works fine, so on with the project.
    Incidentally, I have just bought a rework station. I've messed about with different sized soldering irons for years, while not investing in a station. I'm just getting used to an adjustable voltage iron and oh, what a difference. I also tried the hot air blower today for the first time, so remove the PIC. 10 seconds and flip, great!
    C.
     
  17. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,511
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    I've changed the attached program to match my LCD wiring.
    When I run it, I can see by the LED that the program gets to the LOOP, but there's nothing on the screen.
    Do the connected PINs need pull-ups/downs?
    EDIT: Program update
    C.
     

    Attached Files:

    Last edited: Oct 4, 2017
  18. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,511
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    I've updated the program in #56, but I've come to the realisation that it completely needs re-writing to use the SPI commands in Oshonsoft.
    Here is a TXT with the usual 'Arduino' program, that I can't read properly, but it also has some good set-up information for the 5110.
    If anyone is working on the #56 program, let me know and I'll work with you, otherwise I'll start again with the attached list as guidance.
    C.
     

    Attached Files:

    Last edited: Oct 4, 2017
  19. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    270
    Likes:
    15
    Location:
    Helsinki, Finland
    In #56 the chip select signal lcd_cs is not used anywhere.
    Is it connected to lcd or is the signal to lcd connected directly to Vdd?
     
  20. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    270
    Likes:
    15
    Location:
    Helsinki, Finland
    Can you show the wiring between PIC and Lcd.
     
  21. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,511
    Likes:
    11
    Location:
    Dorset UK.
    Hi J,
    The lcd_cs is connected to PORTA.5, I've changed the program at #56.
    C.
     

Share This Page