Hello NXP professors:
As a newbie to MPC5744p, I've met a problem about how to optimize the execution time of my program.
This is a picture of a code line in my interrupt service routine.
↓This picture show the timer value before executing the code line I have tested
↓This picture show the timer value after executing the code line I have tested
I configured a e-timer(etimer2, channel0) to measure the time intervals between my codes. This timer is configured to clock from MOTC source, and divided by 1, which is 160MHz. My system clock also configured to 160MHz.
Then I found the time to execute this code line is 40 timer cycles, according to 0.25us, that's too slow.
So I wanna know is it normal to use such a long time, or is there any method to further optimize the execution of my codes so that it can use less time.
Greatly thankful!
In general optimization methods are desrcibed in
https://www.nxp.com/docs/en/application-note/AN4939.pdf
main impact have flash configuration, proper PLL setup and enabling cache.
Possibly you could choose higher level of code optimization in the compiler.