Sunday, 16 September 2012

8051 Based 16X2 LCD interfacing include keil(c and hex) and Proteus



Design circuit diagram in Proteus as bellow :-



put all component as shown in figure.

Program:
EN equ P2.0
RS equ P2.1
RW equ P2.2
mov A,#38H             ; Setting Up the LCD
lcall command
mov A,#0EH             ; Display On
lcall command
mov A,#06H             ; Entry Mode
lcall command
mov a,#82H
lcall command
lcall disp                  ; Function Disp Called
mov a,#02H            ; Setting DDRAM Address to Home position
lcall command
lcall delay1

                               Displays fantasy ON FIRST LINE OF LCD

mov a,#'F'
lcall datw
NOP
mov a,#'A'
lcall datw
NOP
mov a,#'N'
lcall datw
mov a,#'T'
lcall datw
NOP
mov a,#'A'
lcall datw
NOP
mov a,#'S'
lcall datw
NOP
mov a,#'Y'
lcall datw
NOP
MOV A,#255       ; Moving Value 255 to PORT 3
MOV P3,A
; Keypad Scan Begins
sd:
lcall delay1
lcall key1
lcall delay
lcall key2
lcall delay
lcall key3
lcall delay
lcall key4
lcall delay
lcall sd




                              Function to Send Commands to LCD

command:
clr RW
clr RS
setB EN
MOV P1,A
lcall delay
clr EN
RET


                           Function to Clear the DDRAM Content

clear:
mov A,#01H
lcall command
lcall delay
mov A,#02H     ; Set The DDRAM Address to Home Position
lcall command
lcall delay
RET

                         Function to Display Data on LCD Screen

datw:
SETB RS
clr RW
SETB EN
MOV P1,A
lcall delay
clr EN
RET

No comments:

Post a Comment

must read

NOTE:-we don't make all projects, all are of from different website.we also don't know where they have taken from.we just helping student and needed people .we are don't responsible for any harm from our website.thank you.