Quote:
|
Originally Posted by gnormhurst
Can someone describe a simple way to measure how much of the 26 ms time budget is being used? As I add code I would like to know how close I am coming to the limit.
Also, how do I know how close I am to the memory limits for code and data?
Thanks all,
Norm
|
To measure the time, you should toggle a digital I/O pin every cycle. Then, hook an oscilliscope up to that pin. Using the scope, you can measure your timing very accurately.
Some example code (place this at the very beginning of your code):
static char TimingFlag;
if (TimingFlag)
TimingFlag = 0;
else
TimingFlag = 1;
Then immediately set the digital I/O pin equal to TimingFlag.
This code will produce a square wave on the scope. The time that the wave is high (or low) is your cycle time. I hope this helps.
-Chris