papunblg
Advanced Member level 3
![Advanced Member level 3](/styles/images/ranks/glevel3.gif)
- Joined
- Oct 22, 2010
- Messages
- 716
- Helped
- 172
- Reputation
- 344
- Reaction score
- 165
- Trophy points
- 1,343
- Location
- Kolkata India
- Activity points
- 6,421
I need to generate 1 sec delay. I use the following code. AT89S52 with 12MHZ XTAL. Number of counts C3F4(49,999) + 1.
But P2.1 going high in less than 1 sec.
ORG 0000H
STT: MOV R0,#20
MOV TMOD,#10H
AGAIN: MOV TL1,#4FH
MOV TH1,#0C3H
SETB TR1
BACK: JNB TF1,BACK
CLR TF1
CLR TR1
DJNZ R0,AGAIN
CPL P2.1
SJMP STT
END
But P2.1 going high in less than 1 sec.
ORG 0000H
STT: MOV R0,#20
MOV TMOD,#10H
AGAIN: MOV TL1,#4FH
MOV TH1,#0C3H
SETB TR1
BACK: JNB TF1,BACK
CLR TF1
CLR TR1
DJNZ R0,AGAIN
CPL P2.1
SJMP STT
END