Continue to Site

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.

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

PIC plus-5110 LCD-GPS-BMP280-HMC5983

Status
Not open for further replies.
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.
 
DC means data/command.
In your program it is lcd_command and is connected to PORTB.7
Hi J,
Thanks.
C.
EDIT: Further reading found this: **broken link removed**
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:
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.
 
I notice that when one LED PIN is high, the other LED PIN shows some movement.
Hi C,
Please define 'movement'?
E
 
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.
 
Connected to the actual LED PIN, showed app 1V,
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
 
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.
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.
 
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
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.
 
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.
 
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
 
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
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.
 
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.
 

Attachments

  • 18lf2520 8MHz INT 5110 041017 1400.txt
    13.6 KB · Views: 368
Last edited:
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.
 

Attachments

  • LEARNING 5110.txt
    11.4 KB · Views: 352
Last edited:
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?
 
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?
Hi J,
The lcd_cs is connected to PORTA.5, I've changed the program at #56.
C.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top