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.

Displaying the TH0, ThL0 value of at89s52 on 2x16 LCD

Status
Not open for further replies.

eehero

Full Member level 3
Joined
Nov 23, 2005
Messages
169
Helped
13
Reputation
26
Reaction score
5
Trophy points
1,298
Location
Libya
Activity points
2,620
Hi all, i am going to use timer 0 of At89s52 as an event counter, after counting i have to read the timer value using the following code:

loop: mov a,th0
mov r6,tl0
cjne a,th0,loop
mov r7,a

finally i get 16 bit data in r6, r7.
how i can display the counting value in r6, r7 on a 2x16 LCD
 

Here is a tutorial on 8051 and 2 x 20 LCD ..
**broken link removed**

Using examples of codes from this tutorial compose the top line as: TH0 = "value from R6" and the bottom line as: TL0 = "value from R7" , or whichever way you like ..

Regards,
IanP
 

First u need to convert hex value to decimal and then to ASCII
then display it.

It seems it is a 16 bit value so 16-bit hex to decimal conversion need to be done.
all the best


-- babesh
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top