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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/07/09 06:40
Read: times


 
#171498 - In theory, zero timers are needed
Responding to: ???'s previous message
It can be done with zero timers too, in case the program has a superloop that has a reasonably stable iteration speed.

The bad thing with just counting number of turns through the superloop is that adding/changing code will change the performance - potentially enough that a user notices it. And an unbalanced superloop that runs differently fast in different modes can be very irritating if it makes a key auto-repeat change the repetition frequency or delay to the initial repetition too much.

That is a reason why the program really should make use of hardware-based timing for keyboard processing.

For some processors, other methods than timers may be used. Having hardware SPI, the time to send x bytes may be used. This method of timing can be used even if no external SPI hardware is connected. It may waste a couple of processor pins but that can sometimes be accepted. In the same way, a potentially unused UART can be used to supply timing if a suitable baudrate setting can be arranged. And many times, a timer used for other tasks may be polled to measure the length of each superloop iteration.

List of 15 messages in thread
TopicAuthorDate
one key, multiple jobs assigned to it            01/01/70 00:00      
   Step by step            01/01/70 00:00      
      What methods do you have for keeping track of time now?            01/01/70 00:00      
         Timing in Siemens ;)?            01/01/70 00:00      
            RC circuit            01/01/70 00:00      
               Yep, touché!...            01/01/70 00:00      
   Another idea...            01/01/70 00:00      
   State machine            01/01/70 00:00      
      State Transition Diagram            01/01/70 00:00      
   Timers can help!!            01/01/70 00:00      
      In theory, zero timers are needed            01/01/70 00:00      
   "I do not have any timer interrupts left."            01/01/70 00:00      
      Software timers            01/01/70 00:00      
   To check debounce            01/01/70 00:00      
      what happens when            01/01/70 00:00      

Back to Subject List