cancel
Showing results for 
Search instead for 
Did you mean: 

Syncing ADC to PWM in center aligned mode for single event per period

prigo87
Associate II

I working on motor control application with stm32g484ret6.
Timer1 generates 3 PWM lines with complementary lines (with some deadtime) in center aligned m

I have ADC readings to sample the phases current.

Timer1 output trigger TRG0 is defined as update event, and the ADC external trigger conversion source is defined as Timer1 Trigger Out event.

However, in this configuration the ADC is triggered twice for each PWM period - once in the middle of the ON time, and one in the middle of the OFF time.

I want to receive only a single trigger for the ADC per PWM period (in the middle of either the on or off time) as the ADC conversion complete callback calls to my entire control algorithm.

How can I config it?

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions

Set up a channel to Output Compare with CCRx=0 or CCRx=ARR, and set the ADC to trigger on this channel (not all channels are available to serve as ADC trigger).

JW

View solution in original post

1 REPLY 1

Set up a channel to Output Compare with CCRx=0 or CCRx=ARR, and set the ADC to trigger on this channel (not all channels are available to serve as ADC trigger).

JW