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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Andy Neil
02/18/08 00:21
Read: 2180 times

#150987 - It's worse than that, Jim
Responding to: Jose Orlando T. Ribeiro's previous message
Jose Orlando T. Ribeiro said:
you have very limited control of the code generated by the compiler regarding number of instructions and machine cycles.

In fact, you have no control whatsoever - see:

But note that delay loops are unlikely to be an appropriate solution for such long delays anyhow - see:

write delay functions yourself and measure it

Even that won't help, since you also have no guarantee whatsoever that the compiler will generate exactly the same code next time - especially if you change compiler settings, or move to a different compiler version, etc.

List of 10 messages in thread
11.059Mhz clock to create 1-30 second delay in C?      Chris Bertrand      02/17/08 18:20      
   as far as I remember...      Jose Orlando T. Ribeiro      02/17/08 18:34      
      It's worse than that, Jim      Andy Neil      02/18/08 00:21      
   solution?      Russell Bull      02/17/08 23:13      
   Not nested loops!      Andy Neil      02/18/08 00:03      
      I'll check those out tonight after work      Chris Bertrand      02/18/08 05:12      
         delay needs to be centered around 5 seconds or so      Andy Neil      02/18/08 05:38      
            Samuel Clemens said      Erik Malund      02/18/08 09:47      
               Couldn\'t use of a different crystal solve this?      Richard Erlacher      02/18/08 13:03      
                  I wonder      Erik Malund      02/18/08 14:05      

Back to Subject List