AnsweredAssumed Answered

STM32 and Timer Interrupt flags

Question asked by valeev.kamil on Aug 5, 2015
Latest reply on Aug 5, 2015 by valeev.kamil
I have a timer3 configured to be 1 ms timer with an interrupt on the overflow:
void InitTIM3()
  TIM_TimeBaseInitTypeDef timer;

  TIM_TimeBaseStructInit(&timer); // Fill structure fields with default values
  timer.TIM_Prescaler = 59;
  timer.TIM_Period = 999;
  TIM_TimeBaseInit(TIM3, &timer);
  TIM_ITConfig(TIM3, TIM_IT_Update, ENABLE);

  TIM3->SR = 0;
  NVIC_ClearPendingIRQ (TIM3_IRQn);

Timer3 is enabled soon in the main() after enabling all interrupts.

When interrupt occurs not only the Update Flag is set in TIM3_SR, but also all Capture/Compare interrupt flags: CC1IF, CC2IF, CC3IF, CC4IF. Though I do absolutely nothing to the CC modules. All corresponding CC registers are 0 and why  does it happen I don't know.

The interrupt handler:

void TIM3_IRQHandler(void)
  if (TIM3->SR & TIM_SR_UIF) {
    TIM3->SR = ~TIM_SR_UIF;

I'm using STM32F205RE, but it also happened on other MCUs.

I wonder if someone knows about this 'issue'. Thank you!