PDA

View Full Version : lcd help hd44780



asimov_18
11-07-2005, 12:05 AM
hi friends,(vikas any ideas about this prob)
i have an alpha-numeric lcd 16x2,bought from shop 614 lajpath rai market . it is made by china aerospace ltd. model no.ccm1620csl(it is supposed to be hd44780 equivalent). i am interfacing it with at89c51. but it seams that lcd is not getting initialized properly. i am putting up my assembly program .can any one find errors in it . my lcd is displaying 16 filled boxes. that it even without sending it any command i wish to know if this indicates any prob with lcd or its common for all lcds. this prog is made on keil or any other assembler.


my assembly prog is as following:-
CBUS EQU P3
DBUS EQU P1
RS EQU P3.0
RW EQU P3.1
EN EQU P3.2
LED EQU P2.4


ORG 0H
SETB LED
MOV DBUS,#0H
MOV CBUS,#0H
ACALL DE30;DE30=30MSEC DELAY
MOV DBUS,#3CH
ACALL SEND
ACALL DE39;DE39=39USEC DELAY
MOV DBUS,#0FH
ACALL SEND
ACALL DE39
MOV DBUS,#01H
ACALL SEND
ACALL DE153;DE153=1.53MSEC DELAY
MOV DBUS,#06H
ACALL SEND
ACALL DE30
;INITILIZATION ENDED


MOV DBUS,#'H'
ACALL DSEND
ACALL DE30
MOV DBUS,#'I'
ACALL DSEND
ACALL DE30
HERE: CLR LED
LJMP HERE


SEND: CLR RS
SETB EN
NOP
CLR EN
RET
DSEND: SETB RS
SETB EN
NOP
CLR EN
RET
DE30: MOV R1,#40
LAB2: MOV R2,#250
LAB1: DJNZ R2,LAB1
DJNZ R1,LAB2
RET

DE39: MOV R1,#14
LAB3: DJNZ R1,LAB3

vikas
11-07-2005, 01:17 AM
About the 16 boxes - check the contrast ( use the 10k trim pot to check ince/dec it ). if at start only half the LCD seems to be working ( 16 boxes [16x2] / 8[16x1] ) ... then nothing is wrong ... ull simply have to intialize the LCD :) - had me puzzeled 4 a while.

Rest ill give a look to the code sometime :) .... 2 late right now .

rohitd
11-07-2005, 12:49 PM
hi,

are you using the 16x2 LCD in 8bit mode?
also check if the LCD is equivalent to 16x2 LCD by lampex.
i think it is, then just try the code and interfacing in the book AYALA for 8051.
it works fine only add delays to the routine after ever acall comand,and the program works fine as it is without any changes.

if delays are less then the LCD dose not respond to any commands.
also it is necessary that you check BF flag after every command given to the LCD.all this is taken care in that cade.
just try it and dont forgett to add the DELAY in the code given by AYALA

rohitd

quasar
11-07-2005, 01:12 PM
MOV DBUS,#3CH

intialize using 0x38... i havent seen any 5x10 lcds in the market.... it must be 5x7... so use 0x38 instead of 0x3C...

Quasar......