ESP32, howto use MCPWM for a ZCD Dimmer


Try to rebuild my ESP8266 ZCD Dimmer with an ESP32.

Now i use an Attiny for ZCD and dimming. the tiny is controlled by serial.
the ESP8266 is for communicating recieve MQTT command's and that kind of stuf.

Recently looking at the ESP32, dual core and thinking of using this module.
because of the dual core, and the ability for hardware PWM MCPWM, i think i can build the dimmer with lesser components. skip the attiny.

But i don't get it how to program the MCPWM.
I have one pin where the puls is from zero cros detection and onoe gate pin.
the next thin is to fire the gate after x time to switch off the power.
on zcd interupt switch on gate to lite the light.

could someone help me out a bit.

Check out this Instrucable, and look at step 3 and the interrupt driven approach.