STM32L476 TIM15, single timer interrupt for delay purpose (630uSec)
I have written a code which test the TIM15 for delay response of 630uSec (using DWT to measure in uSec). Below is the working code (superloop). I have looked into oneshot and could not make it work from CubeMX and TIM15 configuration.
I found it was generating premature interrupt at the start, so I applied the fix by clearing the IT flag (__HAL_TIM_CLEAR_IT) assuming this is the right solution.
if (zsystickobj->zSysTick.zSystick_500mSec_Flag==1)
{
TIM15_UpdateDWT();
__HAL_TIM_CLEAR_IT(&htim15, TIM_IT_UPDATE); // Had to place this code to mitigate premature trigger!
HAL_TIM_Base_Start_IT(&htim15);
zsystickobj->zSysTick.zSystick_500mSec_Flag=0;
}
---------------------
