I’ve figured out how to get an Arduino to do PWM with inversion properly after watching lots of YouTube videos and working against registers but I’d like to use the Xiao or at least an ESP32 because there is more to this project than just the DC/DC conversion that I need to make work (i.e. sensors for voltage and amperage as this is a hybrid MPPT + DC Grid.) So I need to get PWM up into the 1-3 mhz range for the GanFETs that I’m using on the hard-switched ZVS. That means I need to calculate deadtime and inversion of the signals.
Later I’ll be also building a transformerless DC/AC inverter, which I’ll need to be able to get high resolution Sinewaves out of the ESP32 with high speed switching as well (hoping to be able to do a step down half-bridge to the right voltage and then create a ton (i.e. way more than 255) of segements at 50/60hz using the same ESP32.
I’ve looked all over and I can’t find good documentation on inversion of pwm. I was hoping that the pwm() function would have an inversion function or that someone had already created a package for this given that this is a pretty common use but no dice there either.
So does anyone have a generic-ish way of getting pwm timing on 4 pins working with inversion and dead time or even some tips or suggestions? (depending on voltage differential between in and out, 2 of the mosfets will be forced high/low on one or the other side of the bridge so that it goes from boost/buck mode transparently)
My hope is that there’s something that will work generally with all ESP32s and isn’t tied to specifics of the Xiao if possible.