#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:
LCD_DTPIN=PORTC.0 'CALL ASSIGNED ADDRESS TO PORTC.0
LCD_INTERFACE=4 '4 BITS
LCD_LINES=2 '2 LINES
LCD_TYPE=0 '0 = ALPHANUMERIC ; 1 = GRAPHICAL
DelayMS 500 'PAUSE
Cls 'CLEAR SCREEN
Print At 1,1," MCU DESIGN " 'DISPLAY MCU DESIGN MAXIMUM
Print At 2,1," test " 'DISPLAY test
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.
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.
cdb, colin@... on 4/01/2009
Web presence: www.btech-online.co.uk
Hosted by: www.1and1.co.uk/?k_id=