Synchronized two pwm signals with different frequencies
Hello,
I am new to ST and I need some advice. I need to create two pwm signals that are synchronized. PWM A should go to a physical channel and PWM B which runs at half the frequency is supposed to trigger ADC conversion at falling edge.

The signals are synchronized in such a way that the timer counters start counting from zero again at the same time every 100 us. I need to be able to change the duty cycle for both of them in HAL_ADC_ConvCpltCallback(). The reason for the needed synchronization here is that the ADC should not get triggered at the same time as the rising or falling edge of the physical pwm signal.
1. What is the easiest way to achieve this? I am using a stm32G0B1RE and I have to use the HAL interface functions.
2. If I understand the docs correctly I can only scan 8 ADC channels at a time on this MCU. My use case is that I need to scan CH0-CH7 every 100 us but sometimes I also need to scan CH9-CH10 in between. Is it possible to do that or does it get too messy?
3. To get familiar with this I tested for now just letting the signals have the same frequency and configured PWMA and PWMB on channel 4 and 1 of timer 2. But it seems like the ADC gets triggered by either channel, that is even if I only start the channel 4 of the timer the ADC will still get triggered. How can I configure which timer channel will trigger the ADC?
In my test I am using and modifying the example project from ST called ADC_MultiChannelSingleConversion which sets up the ADC with DMA.
