Problem with interfacing LCD with AT89c51
- From: "embedidea" <mithun31@xxxxxxxxx>
- Date: Thu, 13 Jul 2006 04:57:28 -0500
Hello All,
We are trying to interface 16*2 character LCD with Atmel AT89c51. We are
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. and
the A and K pins to VCC and Ground respectively.The code for interfacing
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.
.
- Follow-Ups:
- Re: Problem with interfacing LCD with AT89c51
- From: Paul Carpenter
- Re: Problem with interfacing LCD with AT89c51
- Prev by Date: Micro-pump is cool idea for future computer chips
- Next by Date: Re: 8051 architecture
- Previous by thread: Micro-pump is cool idea for future computer chips
- Next by thread: Re: Problem with interfacing LCD with AT89c51
- Index(es):
Relevant Pages
|