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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/23/11 17:55
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#181997 - Why no timers....
Responding to: ???'s previous message
It is possible that Trangga Findanugroho is falling into the trap that may beginners do, namely they find other uses for each of the timers and then think about the delay at the last minute.

If this is the case I would advise that Trangga take a look at how he is using the timers. Very often an existing timer usage can be modified in one of two ways to support delays:

1) For a timer that was being used to generate a periodic interrupt, for example a 100 Hz tick, it is possible to speed up that timer to generate its tick at 1000 Hz. Use this faster interrupt to count down a variable from 10 to 0, 10 to 0 etc and then take the action of the original interrupt function each time this variable wraps at zero. Then add additional variables that count down from some count to zero to be used as delay counters knowing that these have 1 millisecond resolution.

2) For a timer that is running doing some other job such as generating a baud rate or some other waveform measurement application it is always possible to comprehend the passage of time from successive reads of the timers run time register. Delays can be determined by watching these reading differences over the desired interval.

Michael Karas


List of 17 messages in thread
TopicAuthorDate
How to Delay            01/01/70 00:00      
   Counting cycles            01/01/70 00:00      
      But *not* in a HLL            01/01/70 00:00      
         the problem with cycle counting ...            01/01/70 00:00      
      ok            01/01/70 00:00      
         ???            01/01/70 00:00      
            OK            01/01/70 00:00      
               So what do you do?            01/01/70 00:00      
               sounds crazy            01/01/70 00:00      
               again            01/01/70 00:00      
   Why *no*t using timers?            01/01/70 00:00      
      Why no timers....            01/01/70 00:00      
         "Software" Timers            01/01/70 00:00      
      for another delay            01/01/70 00:00      
         Bad answer            01/01/70 00:00      
         Why ignore replies?            01/01/70 00:00      
            Output-only mode            01/01/70 00:00      

Back to Subject List