Upload
sk087510
View
1
Download
0
Embed Size (px)
DESCRIPTION
about LCD interfacing
Citation preview
M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-11
LCD Interfacing
Liquid Crystal Displays (LCDs) cheap and easy way to display text Various configurations (1 line by 20 X char
upto 8 lines X 80 ). Integrated controller The display has two register
command register data register
By RS you can select register Data lines (DB7-DB0) used to transfer data
and commands
M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-22
Alphanumeric LCD Interfacing
Pinout 8 data pins D7:D0 RS: Data or Command
Register Select R/W: Read or Write E: Enable (Latch data)
RS – Register Select RS = 0 Command Register RS = 1 Data Register
R/W = 0 Write , R/W = 1 Read E – Enable
Used to latch the data present on the data pins.
D0 – D7 Bi-directional data/command pins. Alphanumeric characters are sent in ASCII format.
E
R/W
RS
DB7–DB0
LCD controller
communications bus
Microcontroller
8
LCD Module
M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-33
LCD Commands
The LCD’s internal controller can accept several commands and modify the display accordingly. These commands would be things like: Clear screen Return home Decrement/Increment cursor
After writing to the LCD, it takes some time for it to complete its internal operations. During this time, it will not accept any new commands or data. We need to insert time delay between any two
commands or data sent to LCD
M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-44
Pin Description
M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-55
Command Codes
M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-66
LCD Addressing
M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-77
LCD Timing
M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-88
M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-99
Interfacing LCD with 8051
LM015
8051
P1.7-P1.0 D7-D0
RW
RS
E
P3.4
P3.5
P3.3
M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-1010
Interfacing LCD with 8051
mov A, commandcall cmddelaymov A, another_cmdcall cmddelaymov A, #’A’call datadelaymov A, #’B’call datadelay….Command and Data Write Routinesdata:mov P1, A ;A is ascii data
setb P3.3 ;RS=1 dataclr P3.4 ;RW=0 for writesetb P3.5 ;H->L pulse on Eclr P3.5ret
cmd:mov P1,A ;A has the cmd wordclr P3.3 ;RS=0 for cmdclr P3.4 ;RW=0 for writesetb P3.5 ;H->L pulse on Eclr P3.5ret
M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-1111
Example