Re: [piclist] lcd hd44780 type help


Nov 24, 2008

 


----------------------------

#11105 Nov 24, 2008

hey guyz i'm having a problem in programming an LCD

my LCD is LM052L it has a built in LSI HD44780 and i'm using a

pic16f877a i don't know what's the problem.



this is my picbasic program:



Device=16F877A

XTAL=4

ALL_DIGITAL=true



TRISC=0



LCD_DTPIN=PORTC.0 'CALL ASSIGNED ADDRESS TO PORTC.0

LCD_RSPIN=PORTC.4

LCD_ENPIN=PORTC.5

LCD_INTERFACE=4 '4 BITS

LCD_LINES=2 '2 LINES

LCD_TYPE=0 '0 = ALPHANUMERIC ; 1 = GRAPHICAL



DelayMS 500 'PAUSE



main:



Cls 'CLEAR SCREEN

Print At 1,1," MCU DESIGN " 'DISPLAY MCU DESIGN MAXIMUM

20 CHARACTERS

Print At 2,1," test " 'DISPLAY test



End



This isn't my real program because i'm working on a digital thermostat

which shows its output at the LCD. but first i'm trying to0 figure out

how to run the LCD so this is just a test program. hope you can help me.



My test schematic circuit is uploaded in the files.

schematic_lcd (filename)



i dont know if the problem lies in the program or in the schematic.



----------------------------

#11136 Jan 3 2:01 PM

You haven't said what your problem is.



A guess from your code is that you haven't initialised the LCD or if

LCD_xxxx is an inbuilt function of PicBasic, maybe the timing isn't

correct - that tend to be the biggest problem people find.



If you are seeing black squares only on the top line, then this is

probably a timing problem, but could be that the initialisation code

to put the LCD into 4 bit mode isn't correct.



How have you wired up the WR pin, in 4 bit mode it is normally wired

direct to ground.



If you see nothing on your LCD try playing with the contrast control,

if you then can see faint but fast flickering, then the LCD is

initialised and the timing is incorrect.



Colin

--

cdb, colin@... on 4/01/2009



Web presence: www.btech-online.co.uk



Hosted by: www.1and1.co.uk/?k_id=7988359


S
e
n
i
o
r
T
u
b
e
.
o
r
g