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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/24/06 07:06
Read: times


 
#117004 - Yes I'm looking
Responding to: ???'s previous message

I'm not fully understanding your problem.

You have two subroutines, one gives an approximate delay of 1mS, the other calls this delay routine 512 times. So at a guess, you'll get a total delay of just greater than 512mS. So, how do you get this magic number of 3.4seconds?

Why are your time values approximate? Its not like we have much tolerance here if we're counting cpu cycles - we have known values! I suggest you put the cycle count on each line, and total up each loop count. Since I'm lazy, I'll approximate.

from my approximate counting : = inner LOOPB about (1ms (delayms)+ 6 cycles) * 512 = 515ms (approx) + 2 outer loops of 4 cycles (R5 decrement) = 515ms + 8us.

So we can see that the loop overhead of LOOPB does not contribute much to the overall delay.

List of 8 messages in thread
TopicAuthorDate
wrong calculation of timer delay ...            01/01/70 00:00      
   Comments            01/01/70 00:00      
   Russel Sir ... have a look again pl            01/01/70 00:00      
      Yes I'm looking            01/01/70 00:00      
         Russell Sir ... once again have a look            01/01/70 00:00      
            I'm still looking!            01/01/70 00:00      
   Try this:            01/01/70 00:00      
   Sometimes a Calculator helps            01/01/70 00:00      

Back to Subject List