Hello!
I have an STM32G474QET6 which I am using as a 3-phase + complement generator. I need to maintain deadtime, and freely vary the frequency and duty cycle of the PWM output throughout the duration of the PWM "shot". Frequency and duty cycle are defined as arrays uploaded over homebrew SCPI commands by a human user. Previously I used an STM32L4 for this purpose via direct upload of ARR, CCR (calculated via off-board python script simulating timer behavior) to each timer's register + complement register on a PeriodElapsed callback from the master timer. As far as I can tell, this is a reasonably standard way to do this sort of thing.
Unfortunately, the lack of preload of timers on the L4 and the lack of gated outputs demanded that I redesign the device to tackle some unclean PWM output behavior. I selected the STM32G4 due to the fact it has HRTIM. I underestimated the complexity of using HRTIM devices and at the moment suffer from a bit of paralysis in selecting the best path forward for programming this behavior on my new STM.
What is the most straight-forward way to maintain this functionality on an STM32G4? Should I forget about HRTIM and simply use the advanced timer complementary outputs? Which mode HRTIM should I be using? Does anyone have a similar project they would be willing to share?
Thank you in advance, and my apologies if I didn't provide enough specifics. I am happy to provide examples of my previous work on the L4 to clarify where needed.