-
Notifications
You must be signed in to change notification settings - Fork 7.6k
PWM channels of ESP32 #2660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
what do you see as result on the 9th and 10th channels? |
Voltage on both channels keeps changing between 3.3V and 1.6V. But the actual change should be 3.3V to 1.6V to 0V as per the commands given in code. My board has a builtin LED on gpio 2 which is connected to channel 0 in code. It seems to work fine as per code. But 9th and 10th channel pins behave as mentioned above. |
@me-no-dev : I am not good enough at bitwise math to understand what you are trying to get to here, but it doesn't change the value at all: https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-ledc.c#L207 |
channels 0-7 are connected to HS LEDC and 8-15 are to LS LEDC. There are some differences in the registers and the way they set the clock is different. That value there @lbernstone would change if before that the channel was on. See the bit being set a few lines above. |
Done :) nice find! |
Hardware:
Board: ESP32 Dev Module
Core Installation/update date: 11/jul/2017
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 921600
Computer OS: Windows 8.1
Description:
I want to use 10 PWM channels of ESP32 for certain a task. I found no issue in working with 8 PWM channels at a time but as soon as I configure the 9th channel it does not work correctly. I am sharing a code that should change PWM of 10 channels after small delays. Is there anything wrong done by me in configuring channels?
Sketch:
The text was updated successfully, but these errors were encountered: