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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/17/06 09:53
Read: times


 
#118463 - trouble in stopping the timer
Hello,
i am working on a porgram in which i have to use the timer to count the duration of an event and when the event completes it stop counting it for this purpose i made a program but in it i am getting trouble to make the timer stop counting.

here is the program

ORG 000H
JMP MAIN
ORG 00BH
JMP RPM

ORG 030H
MAIN: MOV TMOD,#01H
MOV TH0,#HIGH(-1000)
MOV TL0,#LOW(-1000)
SETB EA
SETB ET0
JNB P0.0,$
SETB TR0
JB P0.0,$
CLR EA ; Intrupt disabbled as p0.0 goes low
CLR ET0
CLR TR0
JMP DISPLAY

RPM:
MOV TH0,#HIGH(-1000)
MOV TL0,#LOW(-1000)
INC R0 ; value is increamented in R0
RETI

DISPLAY: MOV P1,R0
END

The problem is that as long as the P0.0 is low it stops counting but as it goes high again it starts counting again. But you can see that i have dissabled all the intrupts.
Please tell me how could i solve this problem.
Thanks



List of 8 messages in thread
TopicAuthorDate
trouble in stopping the timer            01/01/70 00:00      
   Stopping timer            01/01/70 00:00      
      Missing stop point in program            01/01/70 00:00      
         Silver platter            01/01/70 00:00      
            Silver Platter treatment            01/01/70 00:00      
               Mind your own business            01/01/70 00:00      
                  Your comment.            01/01/70 00:00      
                  and I thought this was only when asking            01/01/70 00:00      

Back to Subject List