View Single Post
Old 03-27-2009, 10:34 AM   #679 (permalink)
MPaulHolmes
PaulH
 
MPaulHolmes's Avatar
 
Join Date: Feb 2008
Location: Maricopa, AZ (sort of. Actually outside of town)
Posts: 3,832

Michael's Electric Beetle - '71 Volkswagen Superbeetle 500000
Thanks: 1,362
Thanked 1,202 Times in 765 Posts
Hey Matt! The software comes with a program simulator, with a cycle counter and total time used at whatever MHz you want to run things at. The datasheet says the system clock is pretty constant (like a few % plus or minus) so I ran some simulated time tests, and then ran it in real life, noting the times. This was a few weeks ago. They were very very similar. The simulator was very good about the times it gave.

So... I was thinking what you were thinking about how much time the control loop was eating up, given that a new interrupt was going to interrupt itself! (do they do that? hehe) I'm back! I just simulated it. According to the simulator, it was using about 15.5% of the time until the next interrupt under the worst case, where it ran as much code as possible. Code that is usually conditional and wouldn't all happen at the same time, but I made it all happen to make it take as long as possible.

I would expect real world results to fall in the range 15% to 16% based on previous tests.
__________________
kits and boards
  Reply With Quote