cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate a Timer Interrupt on both, Output Compare and Overflow with STM32Cube

Olovskos
Associate II

Hello, I can`t figure out how to achieve the following with STM32Cube HAL.

I need to setup a timer, that counts to a specific value and generate an Interrupt. After this, the timer needs to keep counting up, until it overflows. This Overflow should alos generate an Interrupt. I can`t figure out, how to do this. I also tried PWM -no output but it is not working. I don`t want to set a GPIO, I only need a Timer that acts like a PWM. Count to a value -> Interrupt, keep counting till overflow-Interrupt.

Thanks

1 REPLY 1

Normally, you would set both TIMx_DIER.UIE and one or more of the TIMx_DIER.CCxIE. Then in the ISR, you'd need to check the source of interrupt in TIMx_SR, clear it and act upon it as you need.

I don't Cube.

JW