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

Back to Subject List

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


 
#56810 - RE: Timer interrupt response (LONG)
Responding to: ???'s previous message
Oleg:
Your scheme is a viable trick that happens to work when the desired timer reload value has a value such that the low ordered byte has a value of 00h. It just so happens to work nicely on a processor at 11.0952 MHz when the desired interrupt period is 10 mSec. It is a great trick in that it is very efficient.

All that said however that does not discount the scheme proposed by Dan where the next reload value for the timer as the overflow count in the timer "subtracted" from it before placing the new count into the timer. (Dans example uses ADD because the overflow count goes up. In other processor families where the overfloow count goes down a SUB would be used). I have used a scheme such as Dan's many times and find it to be a good general purpose solution because it works irregardless of whether the low byte of the timer divisor is zero or not. Clearly this more robust code takes more clock cycles and instructions to implement but in many many applications this is not an issue at all. And then with todays newest type processsors, such as Cygnal types, running with a 1X bus cycle clocking and very high bus cycle speeds there is even less impact of using the more general solution.

When I first posted to this thread I linked to examples that had very simple timer re-loading schemes because I feel that it is the best presentation to give to someone who is just learning to code their timer interrupt for the very first time. As the new programmer gains experience it is valuable to show them how the scheme Dan has shown works and point out its advantages. And finally when the programmer reaches an advanced stage and they need to eeek very ounce of performance out of their code it is useful to show them techniques and tricks as shown by Oleg. It is important however that when clever tricks are applied in code that they be commented in a manner so that the in the future when the code is being re-used, ported to another platform, or being modified then the methods being used are clear to the person having to do that future work.

Michael Karas


List of 41 messages in thread
TopicAuthorDate
TIMER HELP            01/01/70 00:00      
   RE: TIMER HELP            01/01/70 00:00      
   RE: TIMER HELP            01/01/70 00:00      
      RE: TIMER HELP            01/01/70 00:00      
         RE: TIMER HELP            01/01/70 00:00      
            RE: TIMER HELP            01/01/70 00:00      
               RE: TIMER HELP            01/01/70 00:00      
                  RE: TIMER HELP            01/01/70 00:00      
               RE: TIMER HELP            01/01/70 00:00      
   RE: TIMER HELP            01/01/70 00:00      
      Timer interrupt response (LONG)            01/01/70 00:00      
         RE: Timer interrupt response (LONG)            01/01/70 00:00      
            RE: Timer interrupt response (LONG)            01/01/70 00:00      
            RE: Timer interrupt response (PS)            01/01/70 00:00      
         RE: Timer interrupt response (LONG)            01/01/70 00:00      
            RE: Timer interrupt response (LONG)            01/01/70 00:00      
               RE: Timer interrupt response (LONG)            01/01/70 00:00      
            RE: Timer interrupt response (LONG)            01/01/70 00:00      
               RE: Timer interrupt response (LONG)            01/01/70 00:00      
                  RE: Timer interrupt response (LONG)            01/01/70 00:00      
                     RE: Timer interrupt response (LONG)            01/01/70 00:00      
                        RE: Timer interrupt response (LONG)            01/01/70 00:00      
                           RE: Timer interrupt response (LONG)            01/01/70 00:00      
                  RE: Timer interrupt response (LONG)            01/01/70 00:00      
               RE: Timer interrupt response (LONG)            01/01/70 00:00      
            RE: Timer interrupt response (LONG)            01/01/70 00:00      
   RE: TIMER HELP            01/01/70 00:00      
   RE: TIMER HELP            01/01/70 00:00      
      RE: TIMER HELP            01/01/70 00:00      
      RE: TIMER HELP            01/01/70 00:00      
      RE: TIMER HELP            01/01/70 00:00      
      RE: TIMER HELP            01/01/70 00:00      
         RE: TIMER HELP            01/01/70 00:00      
            RE: TIMER HELP            01/01/70 00:00      
               RE: TIMER HELP            01/01/70 00:00      
                  RE: TIMER HELP            01/01/70 00:00      
                     RE: Acrobat....            01/01/70 00:00      
                        RE: Acrobat....            01/01/70 00:00      
                           RE: Acrobat....            01/01/70 00:00      
      RE: TIMER HELP            01/01/70 00:00      
         INTERRUPT HELP            01/01/70 00:00      

Back to Subject List