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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/13/03 12:59
Read: times


 
#36326 - RE: how to set the delay time to 15 seconds?
I agree with IJAZ's idea of using the timer interrupt. The timer is quite easy to setup.

In applications such as this I use a generic timer interrupt logic that that has the support for a number of "software" timers. I decide what resolution I need for the timers and I then setup the timer interrupt to occur at this rate. Lets pick 50 millisecond like IJAZ suggested. Lets also say that you only need one software timer (altho you can have more for other parts of the software) and you call it TIMER_A.

The timer interrupt routine is setup to each time check if TIMER_A value is zero or not. If it is non zero then decrement the byte, else do nothing. Assembly code could be...

...
MOV A,TIMER_A
JZ NEXT
DEC TIMER_A
NEXT:
...

Each time the main program code wants to measure a delay in the midst of doing other things it simply writes the needed delay (in 50 millisecond counts) into TIMER_A. Then the main code, in the course of doing whatever it does, can occasionally check TIMER_A value. If it sees that it has gone to zero it knows that the desired time span has expired.

Good Luck
Michael Karas


List of 7 messages in thread
TopicAuthorDate
how to set the delay time to 15 seconds?            01/01/70 00:00      
RE: how to set the delay time to 15 seconds?            01/01/70 00:00      
RE: how to set the delay time to 15 seconds?            01/01/70 00:00      
RE: how to set the delay time to 15 seconds?            01/01/70 00:00      
RE: how to set the delay time to 15 seconds?            01/01/70 00:00      
RE: how to set the delay time to 15 seconds?            01/01/70 00:00      
RE: how to set the delay time to 15 seconds?            01/01/70 00:00      

Back to Subject List