Skip to main content
Olovskos
Associate
October 26, 2018
Question

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

  • October 26, 2018
  • 1 reply
  • 719 views

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

This topic has been closed for replies.

1 reply

waclawek.jan
Super User
October 26, 2018

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