You are on page 1of 6

LAB RECORD

MICROPROCESSOR AND MICROCONTROLLER LAB


(EEE4001)

Name PRATYUSH KRISHANA GUPTA


Register Number 17BEE0172
Slot L41+42
Faculty Name POONABALAM SIR

SCHOOL OF ELECTRICAL ENGINEERING


6. LCD Interface

Aim:

To write a program to interface 16 X 2 LCD display with 8051 microcontroller.

Theory:

A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In
this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers.

1. Command/Instruction Register - stores the command instructions given to the


LCD. A command is an instruction given to LCD to do a predefined task like initializing,
clearing the screen, setting the cursor position, controlling display etc.

2. Data Register - stores the data to be displayed on the LCD. The data is the ASCII
value of the character to be displayed on the LCD.
3. To send any of the commands to the LCD

- For command, make pin RS=0

- For data, make RS=1

- Then send a high – to – low pulse to the E pin to enable the internal latch of the LCD.
Block Diagram
Program:

ORG 0000H

MOV A, #38h

ACALL CMNWRT

ACALL DELAY

MOV A, #0Eh

ACALL CMNWRT

ACALL DELAY

MOV A, #1h

ACALL CMNWRT

ACALL DELAY
MOV A, #80h

ACALL CMNWRT

ACALL DELAY

MOV A, ’V’

ACALL DATWRT

ACALL DELAY

MOV A, ’I’

ACALL DATWRT

ACALL DELAY

MOV A, ’T’

ACALL DATWRT

ACALL DELAY

L: SJMP L

CMNWRT: MOV P1, A

CLR P 0.2

CLR P 0.1

SETB P0.0

CLR P0.0

RET

DATWRT: MOV P1, A

SETB P 0.2

CLR P 0.1

SETB P0.0

CLR P0.0

RET

DELAY: MOV R0, #0FFH

L2: MOV R1, #0FFH


L1: MOV R2, #0FFH

L: DJNZ R2, L

DJNZ R1, L1

DJNZ R0, L2

RET

END

RESULT:

You might also like