PWM not working on ESP32

Any ideas anyone? I have an application using PWM write, the program works fine with a Mega 2560 pro but I would prefer to use an ESP32 board because of the speed, the program runs fine on the ESP board but I get absolutely zero PWM output. Any ideas???

There is not much we can do to help with out additional information. The two most likely things to check are:

  1. Are you using PWM pin on new board? Only specified pins support PWM. You may have to change to a different pin when you change boards.
  2. Try a diff PWM pin. PWM requires timers. Other nodes also require timers. Occasionally, XOD will try to reuse 1 timer for multiple functions, breaking code.

Thanks for the quick reply, I tried several pwm pins, nothing. I then tried just loading the esp32 dev board up with just a pwm write and a tweek number, again no pwm output at all. I also tried other esp32 boards with the same result.

That’s strange. I’ve just tested xod/gpio/pwm-write on an esp32 board labelled: “ESP32-WROOM-32”. I connected an led module (with built-in resistor) to pin 16 and GND. With the following patch I was able to adjust the brightness of the led using the tweak node:
Screenshot 2023-06-12 at 23.14.52

I chose “ESP32 Dev Module” as the board model and used default parameters:

How are you testing the output of the PWM pin?

Testing it with a scope and a test meter

just tried again on pin 16, zero pwm on the scope and zero volts on my test meter. Tried with a 30 pin esp32 board and then with a 38 pin one. Same result.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.