ESP32 with 2 PWM outputs 90° phased

Hi All,

I have this project where I check several incoming signals with help of interupts and timers and based on that, I output 2 square wave signals with 50% dutycycle but phased/shifted 90°. I'm typically good at (or call it lucky) finding snippets I can make to work for me but this doesn't seem so evident.

I have 1 output working stable by using ledcwrite PWM but struggle to get that second, identical but 90° phased output going. Any tips or suggestions ? As I'm doing these interrupts and timers on the input side, I want to keep processing to a bare minimum.

My code has quite some menustructure with a lot of things embedded in it so will not share the whole thing here but can share extracts where relevant, thanks.

speaking to myself here I know :slight_smile: but for now my best option seems to be to generate a second PWM output as a CLK with double the frequency, loop these back to 2 inputs that trigger the logical to compare them and construct the output from that. This requires extra/dedicated logic and looping outputs back to two inputs, interrupts etc, so would be nice if anyone has an idea how to simply achieve this at the PWM backend of the ESP.