Interfacing LCD with 8051 using Keil C – AT89C51

 LCD Interfacing-8051 AT89C51xD2

16*2 Alphanumeric display with backlight is provided on Evaluation Board.

Liquid Crystal Display (LCD) is widely used electronic display module and having a wide range of applications such as calculators, laptops, mobile phones etc.
LCD in ALS 8051 Evaluation Board is connected to Port P2. Before we initialise the LCD Let us understand some basic concepts of LCD.

1)LCD Pin Descriptions:

Normally LCD has 16 pins. The function of each pin is discussed below in the table.
Table 1.1 Pin description of LCD
2) RS (Register Select):
The RS pin is used to select command code register or data register. If RS=0 the command code register is selected which allows us to send the instructions to LCD. If RS=1 the data register is selected which allows us to send data to be displayed o LCD.
3) RW(Read/Write):
R/W input allows the user to write information to the LCD or read info from it. 
R/W =1 when reading
R/W =0 when writing
4) EN (Enable):
when data or command is sent to LCD a high-to-low pulse must applied to the PIN. So Enable pin is toggled by sending first 1 and then 0.
5) LCD Commands: 
 LCD Commands sent to LCD are given in table below with description of each command.
Table1.2 LCD Commands


 Now let us see the Code 
Abhay Kagalkar
Software developer, Blogger, Learner,...