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

LCD Interfacing and Coding

coding of LCD interfacing

Uploaded by

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

LCD Interfacing and Coding

coding of LCD interfacing

Uploaded by

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

LCD Interfacing and Coding

LCD
LCD (Liquid Crystal Display) has liquid crystal molecules
sandwiched between polarized glass sheets. By applying an electric
current, these molecules align, controlling the passage of light. Colour
filters paired with the liquid crystal layer produce vibrant images.
Backlighting illuminates the screen, showcasing the displayed content.

Use of LCD is increasing due to following reasons:


1. The declining prices of LCDs.
2. The ability to display numbers, characters, and graphics. This is in
contrast to LEDs, which are limited to numbers and a few
characters.
3. Incorporation of a refreshing controller into the LCD, thereby
relieving the CPU of the task of refreshing the LCD. In contrast,
the LED must be refreshed by the CPU (or in some other way) to
keep displaying the data.
4. Ease of programming for characters and graphics.
Pin description of LCD

Control the
back light
LCD command codes
LCD Connections

;====================================
LCD_DATA_PORT EQU P1
RS BIT P2.0
EN BIT P2.1
;====================================
LCD connection in Proteus
LCD coding
Initialize the LCD: Send initialization commands to configure
the LCD for communication. This usually involves setting up the
number of lines, and cursor properties. (Values are taken from
table )

ORG 0000H
MOV A, #38H // use 2 lines and 5*7
ACALL write_cmd
MOV A, #0EH //cursor blinking off
ACALL write_cmd
MOV A, #80H // force cursor to first line
ACALL write_cmd
MOV A, #01H //clear screen of LCD
ACALL write_cmd
2. Write the actual data to be displayed: Using DPTR the data is
send to the LCD data port.

MOV DPTR ,#STR

Next_data: MOV A,#00H


MOVC A,@A+DPTR
JZ Finish
ACALL write_data
INC DPTR
SJMP Next_data
Finish: SJMP Finish

STR: DB'<text to be displayed>,0


END
2. Write Data/Commands: Send commands or data to the LCD as needed to
control its behaviour or display content. This typically involves the subroutine
to differentiate between data to be displayed and command.

Subroutine to write command


write_cmd: ACALL Delay1
MOV LCD_DATA_PORT, A
CLR RS
SETB EN
CLR EN
RET

Subroutine to write data


write_data: ACALL Delay1
MOV LCD_DATA_PORT, A
SETB RS
SETB EN
CLR EN
RET

You might also like