Skip to main content
RAdel
Associate
April 6, 2020
Question

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

  • April 6, 2020
  • 3 replies
  • 1702 views

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

This topic has been closed for replies.

3 replies

RAdel
RAdelAuthor
Associate
April 6, 2020

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
RAdelAuthor
Associate
April 6, 2020

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

waclawek.jan
Super User
April 6, 2020

0693W000000VNK1QAO.png

JW