cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G4 and Timer channel 5&6

Eiffel
Associate III

Currently i am writing my own MCAL drivers for G4 MCU's and i dont understand interrupts for timer channels 5&6. Lets assume Timer 1 where you can check interrupt status of CC of channels 5&6 in TIMx_SR on bits 16&17. But there is no mention about activation and deactivation in registers.

So how does it work? Is it activated randomly? 

3 REPLIES 3
TDK
Guru

I suspect that channels 5 and 6 are not able to cause interrupts. Not that they're only available as outputs. But otherwise the CC5IF and CC6IF bits act similar to CC1IF (i.e. get set on match).

 

HAL certainly agrees with this as channel 5 and 6 are not valid inputs to HAL_TIM_PWM_Start_DMA or HAL_TIM_PWM_Start_IT.

If you feel a post has answered your question, please click "Accept as Solution".
Sarra.S
ST Employee

Hello @Eiffel

For Timer 1 on STM32 MCUs, channels 5 and 6 do not generate interrupts, even though there are status bits for these channels in the TIMx_SR register, they are intended for polling purposes only. This means you can check these bits to see if an event has occurred, but you cannot configure the MCU to generate an interrupt based on these events (there are no corresponding interrupt enable bits in the TIM1_DIER register).

This behavior is a design choice.

Thank you! 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Sarra.S
ST Employee

Hello @Eiffel

Do you consider your question as answered? 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.