AnsweredAssumed Answered

Handling CCxOF flags Input Capture Mode

Question asked by John Hite on Mar 21, 2017
Latest reply on Mar 22, 2017 by John Hite

STM32F437

 

In the main code I set ARR to 0xFFFF and PSC to 21000-1, a long count at a leisurely pace. After the timer counts a bit I enable an external event with my function generator. In my ISR experiment I immediately disable the timer ( TIM_Cmd(TIM4, DISABLE);)  and then there is a break point on the next line. At this point I turn off the function generator.

 

As I would expect it sometime occurs that the CC1OF flag is set as well as the CC1IF flag. Reading about the status register in section 6 of RM0090 CCxOF flags are not described as interrupts. However if I do not clear it my program will re-enter the ISR a second time. So it seems that CC1OF does act like an interrupt as UIF nor any CCxIF flags are set.

 

I am also curious why TIM_GetITStatus() and TIM_ClearITPendingBit() do not address the CCxOF flags. As one definitely needs to account for the OF bit and clear it.

 

Thanks,

JH

Outcomes