Other Parts Discussed in Thread: MSP-FET
Tool/software: Code Composer Studio
Hello,
During debugging in CCS 9.2.0 with MSP-FET i am trying to measure the time between two breakpoints using the profile clock. There seems to be a problem counting CPU cycles in case CapTivate library functions are used.
In the following example main_loop_timer counts the milliseconds that are incremented in Timer0_A3 ISR which is called with period 1ms. The endless main loop has a defined period of 10ms. At Breakpoint2 the profile clock correctly shows 159922 CPU Cycles (=10ms @16MHz):
while (1) { timer_start(&main_loop_timer); <-- SWBreakpoint1: CPU cycles = 0 while (timer_get(&main_loop_timer) < 10); // wait the remaining time of the main loop period timer_stop(&main_loop_timer); <-- SWBreakpoint2: CPU cycles = 159922 }
Now if I add a call to CapTivate library function CAPT_updateSensorWithEMCAuto() to the loop, the profile clock shows '123064' at Breakpoint2 and not the expected 159922 CPU Cycles:
while (1) { timer_start(&main_loop_timer); <-- SWBreakpoint1: CPU cycles = 0 /* update and processing of the touch sensor data */ CAPT_updateSensorWithEMCAuto(&CS_0, g_uiApp.ui8AppLPM); while (timer_get(&main_loop_timer) < 10); // wait the remaining time of the main loop period timer_stop(&main_loop_timer); <-- SWBreakpoint2: CPU cycles = 123064 }
A measurement of function CAPT_updateSensorWithEMCAuto() itself returns 6220 CPU Cycles.
Do you have an idea why the library function manipulates the result of the measurement?
Thanks
Ralph