2023-11-23 03:54 AM
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
Solved! Go to Solution.
2023-11-23 05:49 AM - edited 2023-11-23 05:50 AM
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
2023-11-23 05:49 AM - edited 2023-11-23 05:50 AM
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