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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/24/09 08:35
Read: times


 
#163815 - You do not
Responding to: ???'s previous message
You do not "calculate" any loop lengths. You make use of a timer. A timer will - besides running at a fixed and known speed - also take into account any time spent in interrupt handlers. A busy loop (C or assembler) will not know if any ISR has been active.

A timer can also allow longer delays to be handled while the processor spends time doing real work, such as processing received data on the serial port.

For short loops, you can do a busy-loop in assembler. But the busy loop will only guarantee a "minimum" delay, unless you run it with interrupts disabled.

List of 5 messages in thread
TopicAuthorDate
Delay loop in C Programming            01/01/70 00:00      
   you can't            01/01/70 00:00      
      Timer ticks            01/01/70 00:00      
      It's IMPOSSIBLE - but here's how...            01/01/70 00:00      
   You do not            01/01/70 00:00      

Back to Subject List