Other Parts Discussed in Thread: MSP-FET
主题中讨论的其他器件:MSP-FET
工具/软件:Code Composer Studio
您好!
在使用 MSP-FET 在 CCS 9.2.0中进行调试期间、我尝试使用分析时钟来测量两个断点之间的时间。 在使用 CapTIvate 库函数的情况下、计算 CPU 周期似乎会出现问题。
在以下示例中、MAIN_LOOP_TIMER 对 Timer0_A3 ISR 中递增的毫秒进行计数、该 ISR 在1ms 周期内调用。 无限主循环具有10ms 的定义周期。 在 Breakpoint2处、系统配置时钟正确显示159922个 CPU 周期 (=10ms @16MHz):
while (1){ timer_start (&main_loop_timer);<-- SWBreakpoint1:CPU 周期= 0 而(timer_get (&main_loop_timer)< 10);//等待主循环周期 timer_stop (&main_loop_timer)的剩余时间;<-- SWBreakt2:CPU 周期= 159922 }
现在、如果我在循环中添加对 CapTIvate 库函数 CAPT_updateSensorWithEMCAUTO()的调用、则配置文件时钟在 Breakpoint2处显示'123064'、而不是预期的159922 CPU 周期:
while (1){ timer_start (&main_loop_timer);<-- SWBreakpoint1:CPU 周期数= 0 //更新和处理触摸传感器数据*/ CAPT_updateSensorWithEMCAuto (&CS_0、g_uiApp.ui8AppLPM); while (timer_get (&main_prue_loop (&main_ring_rycle)<SW1264)<- main timer_roop 计时器周期数= 1264/ main timer_roop;while main timer r&roop <- timer_r&rycle <- timer_r&roop <- timer r&r&rontr&r&
函数 CAPT_updateSensorWithEMCAuto()本身的测量返回 6220个 CPU 周期。
您是否知道为什么库函数会操纵测量结果?
谢谢
Ralph