Thamks for the answer,
this is the code i used
' PicBasic program to demonstrate operation of an LCD in 4-bit mode
'
' LCD should be connected as follows:
' LCD PIC
' DB4 PortA.0
' DB5 PortA.1
' DB6 PortA.2
' DB7 PortA.3
' RS PortA.4 (add 4.7K pullup resistor to 5 volts)
' E PortB.3
' RW Ground
' Vdd 5 volts
' Vss Ground
' Vo 20K potentiometer (or ground)
' DB0-3 No connect
ADCON1=7
Pause 500 ' Wait for LCD to startup
loop: Lcdout $fe, 1 ' Clear LCD screen
Lcdout "Hello" ' Display Hello
Pause 500 ' Wait .5 second
Lcdout $fe, 1 ' Clear LCD screen
Lcdout "World"
Pause 500 ' Wait .5 second
Goto loop ' Do it forever
the lcd is connected in 4bit mode with pullup resistor on porta.4, i'm compile the program with: pbp lcd.bas -p16f877a
I probed tu pic using blink exammple, ands works fine, the led blinks.
Everything appears correct (as I am sure you know) - things to try and see
- Add another Pause 1000 below ADCON1=7 (for now to give everything more time to settle)
- Add your blink routine at the top to make sure your PIC is alive with this program
- Is MCLR pulled high?
- Do you have both VSS pins connected to GND
- Do you have a decoupler CAP between VDD and VSS?
Let us know
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Hi paul, thanks for your time, currently I have 4,7k resistor on MCLR pin, both vss are connected to gnd and both vdd to +5v. No decoupler caps, i will make a test with a .1uf ceramic cap.
I made the circuit over a breadboard, could be that???
cheers.
Alex
I run LCDs connected from breadboards all the time and they always work - try adding 10uF decoupler in addition to your .1uF bypass on both sets of VDD and VSS.
What brand of LCD? (I know it works for you on the 84A)
Are you sure this 877A PIC is alive with your current program?
Paul Borgmeier
Salt Lake City, UT
USA
__________________
BTW, check this out
http://www.picbasic.co.uk/forum/showthread.php?t=3317
Dave
Always wear safety glasses while programming.
I re-read post #1 OOPPSS
I thought you were using the "A". But do try the TRISA part.
Dave
Always wear safety glasses while programming.
Hello, it works :-), finally i found the problem, it was lcd backlight, in the morning i made some test, for some reason when i disconnect the lcd backlight the entire screen show up black boxes,i change the contrast resistor and could see characters,...nothing more to say, at this moment is working with backlight, one again sorry about my english and thanks to all!!!
Alex.
Glad it works but I am confused ... what is wrong with your English?
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Bookmarks