Part Number: RM44L920
How to count the runtime of the code using Time.h library.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Karthik,
You can easily count the runtime of the code using RTI peripheral. Follow below mentioned steps to measure runtime of the code.
1. Call function "rtiInit" before start count the runtime of the code.
2. Now call the function "rtiStartCounter" from where you want to start the count measurement.
3. Now call the function "rtiStopCounter" at where you want to stop count.
4. Now read the registers "RTIUC" and "RTIFRC" registers.
As we know that RTIUC will get increment for every clock pulse of RTI Clock and RTIFRC will get increment after RTIUC matching with RTICPUC.
So now u can calculate the time period based on the configured values.
Try to do it at your end if you are unable to do that then i will try to create an example project.
--
Thanks & regards,
Jagadish.
Hi Jagadish,
As per my understanding , RTI counter will get reset once the compare value is matched
No, it will not reset after compare match. Please test it to confirm.
And also, please do the steps i mentioned for time calculation.
--
Thanks & regards,
Jagadish.