-
Notifications
You must be signed in to change notification settings - Fork 32
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
Compatibility with ESP32-S2 #18
Comments
@Tasssadar Do you think you can help me with this issue? You have more experience in specific ESP32 modules modification. Is there any define or macro which we can use to check which ESP32 module is used? |
Yeah, you can use defines like |
There is information that ESP32-S2 has an 18-bits LED PWM controller in their datasheet (page 26): https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf Then I don't understand why it didn't work with 16-bits. @f-peri Do you think you can test the code with 18-bits? ledcSetup(_channel, 50, 18); // channel X, 50 Hz, 18-bits depth |
@JarekParal It's been awhile since I've worked on that project, but I'll pull it up and review. I see your point in the ref document: "The accuracy of duty can be up to 18 bits within a 1 ms period." though that wording is a bit vague. The reference I found to 14-bit is: on page 782: "The LED PWM controller has a 14-bit counter that counts up to 2LEDC_TIMERx_DUTY _RES − 1. If the counting value reaches 2LEDC_TIMERx_DUTY _RES − 1, the counter will overflow and restart counting from 0." Thanks again for investigating. |
I got this runtime error while using this library at version 1.0.3 on an ESP32-S3-DevKitC-1
Which indicate the same issue and solution as proposed by @f-peri to change from 16 to 14 bits for this chip too |
Seems like @h2zero has solved it here: https://github.com/h2zero/ServoESP32/tree/s3 |
Should be solved with latest release 1.1.0 |
Hello, thank you for developing this library. I am using the ESP32-S2 and from expressif's documentation, the PWM's are limited to 14-bits. As written, I have not been able to get the code to work on an S2, however, once I changed the ledcSetup call to 14, it works well.
From:
ledcSetup(_channel, 50, 16); // channel X, 50 Hz, 16-bit depth
To:
ledcSetup(_channel, 50, 14); // channel X, 50 Hz, 14-bit depth
You may want to consider with passing this as a variable or creating a function that allows this to be set. Thanks again.
The text was updated successfully, but these errors were encountered: