Skip to main content
sshan.2
Associate III
January 3, 2025
Question

STM32G431 ADC trigger center of PWM pulses using Timer1

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??

 

This topic has been closed for replies.

3 replies

ST Employee
January 3, 2025

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.
sshan.2
sshan.2Author
Associate III
January 3, 2025

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

sshan2_1-1735904844780.png

 

 

ST Employee
January 6, 2025

Hello @sshan.2, could you share your code 

 

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.