Question
1min Timer
hey there
here I try to demonstrate a 1minute Timer using TIM14. I'm using STM32F030k6t6 which has 44236.8MHz clock for timers.
below is my TIM14 config:
htim14.Instance = TIM14;
htim14.Init.Prescaler = 60000;
htim14.Init.CounterMode = TIM_COUNTERMODE_UP;
htim14.Init.Period = 44236;
htim14.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
htim14.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE;
if (HAL_TIM_Base_Init(&htim14) != HAL_OK)
{
Error_Handler();
}and then after MX_TIM14_Init(); I start it with
if(HAL_TIM_Base_Start_IT(&htim14)!=HAL_OK)
{
Error_Handler();
}but the thing is just as I start the program, interrupt happens and I dont know why? just as I start my program, 1minute is not passed, then why this happens?
