Question
STM32F4 Timer count reset
htim5 has been running and I need to zero the count (CNT?).
Do I need to stop, de init, init, then start?
Also it seems HAL_TIM_OC_Init() is being used with HAL_TIM_Base_Start_IT(() on the same timer, TIM5. It is used to to generate interrupts with a period of 0xFFFF FFFF. Is this correct?
htim5.Instance = TIM5;
htim5.Init.Prescaler = 83;
htim5.Init.CounterMode = TIM_COUNTERMODE_UP;
htim5.Init.Period = 0xffffffff;
htim5.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
// htim5.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
if (HAL_TIM_OC_Init(&htim5) != HAL_OK)
{
Error_Handler();
}HAL_TIM_Base_Start_IT(&htim5);Thanks
