Hello All,
We are trying to interface 16*2 character LCD with Atmel AT89c51. We ar using ACM1602A. the connection to the 8051 is port 1 is used for data i.e DB0-DB7 of LCD and the RS,R/W,E pins to P2.0,P2.1,P2.2 respectively. an the A and K pins to VCC and Ground respectively.The code for interfacin is as follows.
------------------------------------------------------------------------- ORG 0000H; LJMP MAIN; ORG 0030H; MAIN: ACALL INITIALISE;//first initialising the LCD MAIN1: MOV A,#'M'; ACALL DISPLAY; HERE: SJMP HERE; INITIALISE: MOV A,#038H;//selecting 2 rows. ACALL CONFIGURE; MOV A,#0EH;//displaying the cursor. ACALL CONFIGURE; MOV A,#06H; ACALL CONFIGURE; RET; DISPLAY: MOV P1,A; SETB P2.0;//Setting RS CLR P2.1;//Clearing R/W SETB P2.2;//Setting E. CLR P2.2;//Clearing E. RET;
CONFIGURE: CLR P2.0;//Clearing RS. CLR P2.1;//Clearing R/W. MOV P1,A; SETB P2.2;//Setting E. CLR P2.2;//Clearing E. RET; END;
------------------------------------------------------------------------- Sorry for such a long post. Awaiting help at the earliest.
Thanks in advance.