cancel
Showing results for 
Search instead for 
Did you mean: 

Capture compare interrupts flags always high with 32-bit timer (TIM5) on STM32F427

RAdel
Associate II

I need to use all four Capture-Compare interrupts to use multiple timeouts for TIM5 on STM32F427. It is a 32-bit timer.

The problem I am running into is that the interrupt flags are constantly high (e.g. CC4IF,CC3IF,etc.) . As long as only one CC-interrupt is enabled I can "fix" it by checking which interrupt is enabled. However, using the 32-bit mode or enabling multiple CC-interrupts at the same time would imply a huge overhead in the ISR...

Could anybody tell me why the flags (CC4IF, CC3IF, CC2IF, CC1IF, UIF) are constantly high and even cannot be cleared?

Thanks.

Best,

Rolf

3 REPLIES 3
RAdel
Associate II

Alright, I have solved the mystery why I couldn't clear the flags.

--> solution: stop the counter in debug mode:

DBGMCU->APB1FZ |= DBGMCU_APB1_FZ_DBG_TIM5_STOP;

Now I am trying to get it running in 32-bit mode...

RAdel
Associate II

STILL I seem to not fully understand the mechanics:

If I set the the configuration to the following:

  • TIM5->CCR1 = 0x6000,
  • TIM5->CCR2 = 0x7000,
  • TIM5->CCR3 = 0x8000,
  • TIM5->CCR4 = 0x9000,
  • TIM5->ARR = 0x7500

to my understanding the flag CC3IF should never be high... However it IS high after the timer has been reloaded (i.e. after TIM5->CNT == TIM5->ARR)

Please enlighten me :D

0693W000000VNK1QAO.png

JW