大家好、我是在尝试捕获执行时隙前的时间和执行后的时间。 我尝试使用DL_TimerG_getCaptureCompareValue(CAPTURE_0_INST, DL_TIMER_CC_1_INDEX);
,但捕获的值没有改变
您能 尽快帮我解决这个问题吗?
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.
大家好、我是在尝试捕获执行时隙前的时间和执行后的时间。 我尝试使用DL_TimerG_getCaptureCompareValue(CAPTURE_0_INST, DL_TIMER_CC_1_INDEX);
,但捕获的值没有改变
您能 尽快帮我解决这个问题吗?
您好、 高级
以下是捕获代码执行时间的示例代码:
首先在 syscfg 中启用系统节拍、并设置足够大的 Load 值。
/** * System tick */ //Start System Tick SysTick->CTRL = (SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk); //Calculate System Tick Read Cycles SysTickStr = SysTick->VAL; SysTickStp = SysTick->VAL; SysTickRd = SysTickStr - SysTickStp; //Calculate: SysTickStr = SysTick->VAL; //User code Start //User code End SysTickStp = SysTick->VAL; SysTickCnt1 = SysTickStr - SysTickStp - SysTickRd; //SysTickCnt1 is the result
此致、
赫利克
你好、 santhosh
您可以从 以下代码示例开始: timx_timer_mode_one_shot_standby_lp_MSPM0L1306_nortos_ticlang
只需使用该代码示例开始使用计时器计算 exe 时间:
DL_TimerG_startCounter(TIMER_0_INST); //User code //Read current counter value counter_read = counter_register
以下是计数器值:
赫利克