AnsweredAssumed Answered

How to trigger an interrupt during PWM on time?

Question asked by Haxhi.Nikollaq on Oct 1, 2016
Latest reply on Oct 2, 2016 by Haxhi.Nikollaq
Hi you all,

I'm new to STM32 and I have been trying to find my way around the peripherals using STM's HAL library and STM32Cube.

I've already configured my board in order to use some peripherals:


    Timer 2 for running an interrupt with a certain frequency


    Timer 3 for running PWMs on 3 channels of it.


    ADC with 4 channels, into DMA mode, for reading some analog input.


Let us suppose, now, that the PWM's whole period is 100 ms and its  duty cycle is 50% (50 ms PWM on and 50 ms PWM off).

I would like to trigger an interrupt after a certain time of the PWM on level, let us say 50% of it.

Hence, I would like to run an interrupt at 25 ms in order to trigger the ADC for sampling it's analog inputs.

Do you have any suggestion on how could I implement such a kind of interrupt?

Thank you in advance for your help!