Question
F427 - Timer interrupts right after start?
Posted on January 11, 2016 at 11:46
Hi Guys,
I am setting up my F427 with a master-slave timer (TIM4->TIM1). TIM4 triggers two capture and compare interrupts, CC2 (CCR2 = 1), and CC4 (CCR4 = 5000). TIM1 is triggered by CC2 signal. The behavior of the configuration is correct, unfortunately when I start the master-slave timer with:/* start slave-timer */
if
(IS_TIM_ADVANCED_INSTANCE(TimSlaveHandle.Instance) != RESET)
{
/* Enable the main output */
__HAL_TIM_MOE_ENABLE(&TimSlaveHandle);
}
/* Enable the Peripheral */
__HAL_TIM_ENABLE(&TimMasterHandle);
the interrupts are triggered right after. In this regard I found this link
https://electronics.stackexchange.com/questions/161967/stm32-timer-interrupt-works-immediately
. If I debug, the UIF and the UE flags are cleared, but I still get the interrupts of CC2 & CC4. If I read the manual right (p. 520), this is the correct behavior. Am I right? In other words, when I start my PWM counter it immediately triggers an interrupt? Thanks you for your time and help. eimer #interrupt #flag #updat #interrupt #stm32 #stm32 #timer #timer #timer