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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/03/10 08:28
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#173769 - Can't do it without assembly.
Responding to: ???'s previous message
C gives no guarantees on how exactly created assembly will do what the source code states. Theoretically, the compiler could insert random NOPs in the code if it feels like it. If you need cycle-exact delays, assembly is the way to go.

If you demands aren't that strict, using a timer (or other otherwise unused peripheral that can measure time) should work. This can be done in C.

List of 9 messages in thread
TopicAuthorDate
fixed length delays in C            01/01/70 00:00      
   Can't do it without assembly.            01/01/70 00:00      
      HLL gives no guarantees            01/01/70 00:00      
      Using a timer in C            01/01/70 00:00      
         overheads            01/01/70 00:00      
            Use a dedicated timer            01/01/70 00:00      
               non-functional code            01/01/70 00:00      
                  Interrupts aren't the biggest problem ...            01/01/70 00:00      
   break apart            01/01/70 00:00      

Back to Subject List