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.
|