How to use timer in at89s52

Status
Not open for further replies.
Joined
May 20, 2017
Messages
54
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
0
how to set and use timer 0 and timer 1 in at89s52 to develop 2sec delay and blink led with it help in assembly language
 

Hi,

I assume there are more than 100.000 examples in the internet. What's wrong with them?
Usually the description in the datasheet should be sufficient.
But I'm very sure there are video tutorials also...

Have you tried it on your own? Where is the code? What is happening? How did you try to debug it?

Klaus
 
hello
how to make big delay with this?

Code:
ORG 0000h
 

MOV TMOD,#01h

//Timer0 16-bit Mode

loop:    
 
MOV TH0,#0x00
 
MOV TL0,#0x00
//For generating 0.05 Sec delay
CLR p0.0
//Turn ON LED

SETB TR0
// Start Timer 0
JNB TF0,$
// Wait till Timer 0 overflows
CLR TF0//Timer0 has overflowed clear the Flag

CLR TR0
//Stop Timer0
SETB p0.0
//Turn OFF LED
MOV TH0,#0x00

MOV TL0,#0x00
//Reload Timer0 For generating 0.05 Sec delay
SETB TR0
// Start Timer 0
JNB TF0,$
// Wait till Timer 0 overflows
CLR TF0
//Timer0 has overflowed clear the Flag
CLR TR0
//Stop Timer0
ajmp loop
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…