Problem with timer interrupt STM32F427Vit6 (TIM14)
Hi everyone!
In my program I have an input which is turning on and off. If the input is not turn on in 3 second I need to detect this. I'm using Timer14 with interrupt. If the input is turn on, the timer is stopped, reseted and start counting from the beginning. If not (timer count to the end) the timer SHOULD give me an interrupt.
My problem interrupt. When I start the timer, It immediately gave me the interrupt after that I never get interrupt from timer again.
In my code I use:
HAL_TIM_Base_Start_IT(&htim14); // Start timer
__HAL_TIM_SET_COUNTER(&htim14, 0); // Reset tiemr if input was turnOn
HAL_TIM_Base_Stop_IT(&htim14); // Stop counterDid I missed something... maybe interrupt flag reset? or something else?
Thank you for any answer.
Best wishes,
Domen