Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/23/04 05:15
Read: times


 
#76264 - Handling the timer
Hello,
i m facing a problem during handling the the timer0 of 89C51 controller.
i m actually making a program of 6second during which it will count the high bits on the p1.0 and display the counts as rpm by muliplying the value of 6sec *10 and sending it on to the port2 and 0.
this program was made on asm51 assembler

org 000h
jmp main
org 00bh
JMP TA
ORG 030H
MAIN: MOV R1,#100
MOV B,#1010B
MOV P1,#00H
MOV TMOD,#01H
MOV TH0,#HIGH(5536)
MOV TL0,#LOW(5536)
SETB EA
SETB ET0
SETB TR0


ALI: JNB P1.0,$
INC DPTR
jb p1.0,$
JMP ALI

TA: MOV TH0,#HIGH(5536)
MOV TL0,#LOW(5536)
DJNZ R1,SKIP
MOV A,DPL
MUL AB
MOV P2,A
MOV R0,B
MOV B,#1010B
MOV A,DPH
MUL AB
MOV B,R0
ADD A,B
MOV P3,A
MOV R1,#100
MOV DPTR,#0000H
RETI
SKIP: JNB P1.0,$
INC DPTR
JB P1.0,$
SJMP SKIP

END
Actually when the timer jumps on to the skip subroutine. the controller is hanged.

Pls reply.
Thanks

List of 9 messages in thread
TopicAuthorDate
Handling the timer            01/01/70 00:00      
   RE: Handling the timer            01/01/70 00:00      
   RE: Handling the timer            01/01/70 00:00      
      RE: Handling the timer            01/01/70 00:00      
         RE: Handling the timer            01/01/70 00:00      
   RE: Handling the timer            01/01/70 00:00      
      RE: Handling the timer            01/01/70 00:00      
   Interrupt discipline...            01/01/70 00:00      
   RE: Handling the timer            01/01/70 00:00      

Back to Subject List