Hi Krishna,
I am afraid that the “the API (Autonomous periodic interrupt) at 1 micro second” is not the right idea.
- The API clock is much slower. The default ACLK frequency is 20kHz (or 10kHz – it depends on ACLK definition). So, you cannot interrupt CPU every 1us.
- The every jump/return to/from interrupt needs some time. For simplicity, we could calculate with 8-10 bus cycles per every enter/leave. So even for highest 50MHz bus clock, you need at least 0.32us just for handling interrupt routine (stack/unstack,…)
For the CPU load analysis, we typically use the idle task with the lowest priority between tasks.
This task does nothing (just simple endless loop) or simply counts a counter.
You could periodically read this counter and see how much it counts per unit time. If the difference from the last check will be 0, the CPU load is 100%. The value for 0% CPU load depends on idle task code, counter size and length of the periodic check. You could simply measure it when you block all your task except idle task and task who check the counter value.
I hope it helps you.
Have a great day,
Radek
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------