College of Engineering and Technology
College of Engineering and Technology
College of Engineering and Technology
BME DEPARTMENT
MGMCET
BME DEPARTMENT
ACKNOLEGEMENT
We wish to express our
profound thanks to those Who helped in making this
project a reality. Much needed support and help is
provided by some of our seniors. We would like to
thank Prof. Preeti Athavale Whose suggested the
right subject and guided us to make this Project
successful. We also wish to thank Hanif Sir for
encouraging
and
supporting
us
on
occasions.
numerous
MGMCET
BME DEPARTMENT
Symbol
VSS
VDD(VCC)
VEE
RS
R/W
E
DB0
DB1
DB2
DB3
DB4
DB5
I/O
I
I
I/O
I/O
I/O
I/O
I/O
I/O
I/O
Description
Ground
+5V power supply
Contrast control
command/data register selection
write/read selection
Enable
The 8-bit data bus
The 8-bit data bus
The 8-bit data bus
The 8-bit data bus
The 8-bit data bus
The 8-bit data bus
MGMCET
13
14
DB6
DB7
BME DEPARTMENT
I/O
I/O
R/W - read/write:
R/W input allows the user to write information to the LCD or read information from it.
R/W = 1 when reading; R/W =0 when writing.
E - enable:
The enable pin is used by the LCD to latch information presented to its data pins. When
data is supplied to data pins, a high to low pulse must be applied to this pin in order for the LCD to
latch in the data present at the data pins. This pulse must be a minimum of 450 ns wide.
D0 D7:
The 8 bit data pins, D0 D7, are used to send information to the LCD or read the contents
of the LCDs internal registers.
To display letters and numbers, we send ASCII codes for the letters A Z, a z, and
numbers 0 9 to these pins while making RS = 1.
MGMCET
BME DEPARTMENT
There are also instructions command codes that can be sent to the LCD to clear the
display or force the cursor to the particular position
Code (hex)
1
2
4
5
6
7
8
A
C
E
F
10
14
18
1C
80
C0
38
MGMCET
BME DEPARTMENT
MGMCET
BME DEPARTMENT
ACALL COMNWRT
ACALL DELAY
MOV A,#0EH
ACALL COMNWRT
ACALL DELAY
MOV A,#01
;
;
ACALL COMNWRT
ACALL DELAY
MOV A,#06H
ACALL COMNWRT
ACALL DELAY
MOV A,#84H
ACALL COMNWRT
ACALL DELAY
MOV A,#'H'
;
;
ACALL DATAWRT
ACALL DELAY
MOV A,#'E'
;
;
ACALL DATAWRT
DELAY
; ACALL
MOV A,#'L'
ACALL DATAWRT
ACALL DELAY
;
;
MGMCET
BME DEPARTMENT
MOV A,#'L'
ACALL DATAWRT
ACALL DELAY
;
;
MOV A,#'O'
ACALL DATAWRT
MOV P1,A
CLR P2.0
CLR P2.1
SETB P2.2
ACALL DELAY
CLR P2.2
RET
DATAWRT:
MOV P1,A
SETB P2.0
CLR P2.1
SETB P2.2
ACALL DELAY
CLR P2.2
RET
DELAY: MOV R3,#50 ; HERE2:
MOV R4,#255 ;
HERE: DJNZ R4,HERE ; DJNZ
R3,HERE2
RET
END
MGMCET
BME DEPARTMENT
Program in Keil:-
1)
2)
Microcontroller & Embedded Systems (VI-CBSGS)
MGMCET
BME DEPARTMENT
Connection in Proteus:-
MGMCET
BME DEPARTMENT