LCD Interfacing and Coding
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.
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.