- Back to Home »
- LCD Interfacing , LCD Interfacing with 8051 , Timer on LCD »
- Program for timer on LCD
Timer on lcd:
org 00h
lcd equ p0
rs equ p1.0
rw equ p1.1
en equ p1.2
mov lcd,#38h
acall cmd
acall delay
mov lcd,#06h
acall cmd
acall delay
mov lcd,#01h
acall cmd
acall delay
mov lcd,#0ch
acall cmd
acall delay
mov lcd,#85h
acall cmd
nop
mov lcd,#'0'
acall disp
mov lcd,#86h
acall cmd
nop
mov lcd,#'0'
acall disp
nop
mov r6,#10 //////*********1st**********//////
mov dptr,#300h
svt2: clr a
movc a,@a+dptr
mov lcd,#86h
acall cmd
mov lcd,#'0'
acall disp
mov lcd,#85h
acall cmd
mov lcd,a
acall disp
inc dptr
mov r0,dpl
mov r3,dph
mov r5,#10
mov dptr,#200h
svt: clr a
movc a,@a+dptr
mov lcd,#86h
acall cmd
acall delay
acall delay
acall delay
acall delay
acall delay
mov lcd,a
acall disp
inc dptr
djnz r5,svt
mov dpl,r0
mov dph,r3
djnz r6,svt2
abc2: sjmp abc2
cmd: clr rs
clr rw
setb en
acall delay2
clr en
ret
delay2: mov r4,#0cch
asg2: mov r7,#01h
asg: djnz r7,asg
djnz r4,asg2
ret
disp: setb rs
clr rw
setb en
acall delay2
clr en
ret
delay: mov r1,#0f1h
here1: mov r2,#0ffh
here: djnz r2,here
djnz r1,here1
ret
org 200h
db '123456789'
org 300h
db '0123456789'
end