11
M_nokhodchian @ yahoo.com M_nokhodchian @ yahoo.com Microprocessors Microprocessors 1- 1- 1 1 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

10 Peripheral(LCD)

Embed Size (px)

DESCRIPTION

about LCD interfacing

Citation preview

Page 1: 10 Peripheral(LCD)

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

Page 2: 10 Peripheral(LCD)

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

Page 3: 10 Peripheral(LCD)

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

Page 4: 10 Peripheral(LCD)

M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-44

Pin Description

Page 5: 10 Peripheral(LCD)

M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-55

Command Codes

Page 6: 10 Peripheral(LCD)

M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-66

LCD Addressing

Page 7: 10 Peripheral(LCD)

M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-77

LCD Timing

Page 8: 10 Peripheral(LCD)

M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-88

Page 9: 10 Peripheral(LCD)

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

Page 10: 10 Peripheral(LCD)

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

Page 11: 10 Peripheral(LCD)

M_nokhodchian @ yahoo.comM_nokhodchian @ yahoo.com MicroprocessorsMicroprocessors 1-1-1111

Example