cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G431 ADC trigger center of PWM pulses using Timer1

sshan.2
Associate III

Hi Team,

I am generating the PWM with center aligned mode by using the Timer1 at 62.5Khz.

this PWM is going to Bridge circuit, at this time I have to read the ADC2 with this frequency hence I made ADC trigger with Timer1 out event.

I am able to read but I need the ADC to read at center of the PWM pulses. Please let me know how to achieve this??

 

2 REPLIES 2
Sarra.S
ST Employee

Hello @sshan.2

You can set the ADC trigger source to Timer1's compare match interrupt or event, and configure the compare match value to be half of the Timer1 period value. When triggered ADC starts the conversion.

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.

i got this output but it is not at the center of the PWM pulse

sshan2_1-1735904844780.png