Skip to main content
Explorer II
January 3, 2025
Question

STM32G431 ADC trigger center of PWM pulses using Timer1

  • January 3, 2025
  • 2 replies
  • 833 views

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.

    2 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.

    sshan.2Author
    Explorer II
    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