On a STM32F407VE device i have a timer2 which reads 3 hall sensors from a bldc motor, this timer is feeding the trigger signal into a advanced timer1 which generates 6pwm's for the transistor bridge.
The reading of the hall sensors and the comutation step configs, are made inside the timer2 cc1 irq handler.
The FET signals are TIM_OCMode_PWM1 for high side channels ( CH1, CH2,CH3) and for low side channel ( CH1N, CH2N, CH3N) its just regular low/high state
Till here everything is ok, the signals have the corect phase
But i was thinking to ad a current measurement feature using one ADC channel ( ADC_Channel_14 on PC4 pin) which reads a shunt resistor between low side FET's and ground(GND).
Since i use pwm I was wondering if there is any method using ADC to sync the aquisition trigger on the "on state" of the pwm signals?
Do i need DMA for this? since i work only with one physical adc channel
What is.. lets say common practice to configure ADC to capture in sync with pwm "on time"? Maybe a code reference would be also fit well.