Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to display timer values that is TH0 and TL0 on 16*2 LCD using 89s51

Status
Not open for further replies.

Zohaibmaroof

Member level 2
Joined
Oct 10, 2010
Messages
50
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,832
i want to display timer 0 values that is TH0 and TL0 on LCD but i am facing many problems below is the programe to initialize , to write , read for LCd display at its end there is written "data1:" below which i write that converts hex to ASCII code but its not working , if any body know how to display then do let me know
i will saved the TH0 in R2 and TL0 in R1 register change the below programe assuming that R2=TH0, R1=TL0

org 0000h
rs equ p1.5
rw equ p1.6
en equ p1.7
lcd_data equ p2
acall lcd_initialize
mov a,#080h
acall command_write
mov dptr,#data1
acall print_data
sjmp $
lcd_initialize:
mov a,#38h
acall command_write
mov a,#0eh
acall command_write
mov a,#01h
acall command_write
mov a,#06h
acall command_write
ret
command_write:
acall delay
mov lcd_data,a
clr rs
clr rw
setb en
acall delay
clr en
ret
data_write:
acall delay
mov lcd_data,a
setb rs
clr rw
setb en
acall delay
clr en
ret
delay:
mov r0,#10
l22: mov r1,#111
l11: mov r2,#20
djnz r2,$
djnz r1,L11
djnz r0,L22
ret
print_data:
clr a
movc a,@a+dptr
cjne a,#0,print
sjmp end_print
print:
acall data_write
inc dptr
sjmp print_data
end_print:
ret
data1:
mov b,#10
div ab
mov r2,b
mov b,#10
div ab
orl a,#30h
mov r4,a
mov a,b
orl a,#30h
mov r3,a
mov a,r2
orl a,#30h
mov r2,a
db a,0
end
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top