STM32F407 timer question?
Hi,
I am trying to use either TIM13 or TIM14 but the ISR never get trigger.
My questions are
- Why the ISR routine never trigger? Is there anything else need be set?
- how to control the timer? what's the prescaler, period mean?
- If I want setup the timer trigger say every 10 ms how to?
Thx
****
startup_stm32f407xx.s
.word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */
.word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */
/* TIM13 init function */
void MX_TIM13_Init(void)
{
htim13.Instance = TIM13;
htim13.Init.Prescaler = 0;
htim13.Init.CounterMode = TIM_COUNTERMODE_UP;
htim13.Init.Period = 0;
htim13.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
if (HAL_TIM_Base_Init(&htim13) != HAL_OK)
{
_Error_Handler(__FILE__, __LINE__);
}
}
/* TIM14 init function */
void MX_TIM14_Init(void)
{
htim14.Instance = TIM14;
htim14.Init.Prescaler = 0;
htim14.Init.CounterMode = TIM_COUNTERMODE_UP;
htim14.Init.Period = 0;
htim14.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
if (HAL_TIM_Base_Init(&htim14) != HAL_OK)
{
_Error_Handler(__FILE__, __LINE__);
}
}