0% found this document useful (0 votes)
67 views

LCD Interfacing:: PIN No Name Function

The document describes how to interface with a 16x2 LCD display module. It discusses the pin configurations of the LCD module and common commands used to initialize, clear, and position the cursor on the display. It also provides code to initialize the LCD and display the message "WELCOME" by sending character codes to the data pins in a loop.

Uploaded by

Piyush chaudhari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

LCD Interfacing:: PIN No Name Function

The document describes how to interface with a 16x2 LCD display module. It discusses the pin configurations of the LCD module and common commands used to initialize, clear, and position the cursor on the display. It also provides code to initialize the LCD and display the message "WELCOME" by sending character codes to the data pins in a loop.

Uploaded by

Piyush chaudhari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

LCD INTERFACING:

• LIQUID CRYSTAL DISPLAY (LCD) is used in digital devices like digital


voltmeter/ammeter, digital clock,home automation displays, digital code
locks, display for music players, etc.
• The most commonly used displays are 16×2 (Double Line and 16 characters
per line). It consists of 16 rows and 2 columns.

• There are 16 pins in the LCD module, the pin configuration us given below-
PIN
NO NAME FUNCTION
1 VSS Ground pin
2 VCC Power supply pin of 5V
3 VEE Used for adjusting the contrast commonly attached to the potentiometer.
RS is the register select pin used to write display data to the LCD (characters),
4 RS this pin has to be high when writing the data to the LCD. During the
initializing sequence and other commands this pin should low.
5 Reading and writing data to the LCD for reading the data R/W pin should
R/W be high (R/W=1) to write the data to LCD R/W pin should be low (R/W=0)
6 Enable pin is for starting or enabling the module. A high to low pulse of
E about 450ns pulse is given to this pin.
7 DB0 LSB of data
8 DB1
9 DB2
10 DB3
11 DB0-DB7 Data pins for giving data(normal data like numbers characters
DB4 or command data) which is meant to be displayed
12 DB5
13 DB6
14 DB7 MSB of data
15 LED+ Back light of the LCD which should be connected to Vcc
16 LED- Back light of LCD which should be connected to ground.
Follow are the simple steps for displaying a data
• E=1; enable pin should be high
• RS=1; Register select should be high
• R/W=0; Read/Write pin should be low.
To send a command to the LCD just follows these steps:
• E=1; enable pin should be high
• RS=0; Register select should be low
• R/W=0; Read/Write pin should be high.
Commands: There are some preset commands which will do a specific task
in the LCD. These commands are very important for displaying data in LCD.
The list of commands given below:
Command Function
0F For switching on LCD, blinking the cursor.
1 Clearing the screen
2 Return home.
04 Decrement cursor
06 Increment cursor
0E Display on and also cursor on
80 Force cursor to beginning of the first
line C0 Force cursor to beginning of second line
38 Use two lines and 5x7 matrix
83 Cursor line 1 position 3
3C Activate second line
C3 Jump to second line position
3 C1 Jump to second line position1
Programming LCD to 8051:
Coming to the programming you should follow these steps:
• STEP1: Initialization of LCD.
• STEP2: Sending command to LCD.
• STEP3: Writing the data to LCD.
Initializing LCD: To initialize LCD to the 8051 the following instruction
and commands are to be embed in to the functions
• 0×38 is used for 8-bit data initialization.
• 0xFH for making LCD on and initializing the cursor.
• 0X6H for incrementing the cursor which will help to display another
character in the LCD
• 0x1H for clearing the LCD.
Sending Data to the LCD:
• E=1; enable pin should be high
• RS=1; Register select should be high for writing the data
• Placing the data on the data registers
• R/W=0; Read/Write pin should be low for writing the data.
INTERFACING DIAGRAM:
PROGRAM:
AIM: To display the message “WELCOME”

MOV R7, #07H


MOV R1, #30H
AGAIN: ACALL LCD_INIT
NEXT: MOV A, @R1
ACALL LCD_DATA
INC R1
DJNZ R7, NEXT
SJMP AGAIN

LCD_INIT: MOV A, #01H


ACALL LCD_COMM
MOV A, #38H
ACALL LCD_COMM
MOV A, #0FH
ACALL LCD_COMM
MOV A, #06H
ACALL LCD_COMM
RET

LCD_COMM: CLR P3.4


CLR P3.2
MOV P1, A
SETB P3.3
ACALL DELAY
CLR P3.3
RET
LCD_DATA: SETB P3.4
CLR P3.2
MOV P1, A
SETB P3.3
ACALL DELAY
CLR P3.3
RET

You might also like