-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
ESP32-S2 PWM for a Servo pulse #5050
Comments
It seems like something is wrong at the higher resolutions. Can you test at 10 bit and scale your timings to fit? |
Using this; const int PWMFreq = 50; //50hz Gives me a pulse period of 250uS. I need to set PWMFreq = 4096; to get back to a 20mS period. |
In testing an analogWrite library I wrote (using a ESP32S2-Saola-1M) that uses the latest commit here (it wraps the ledc functions) here from 2 days ago, I find that the set frequency is off by a factor of 80. Need to use 80000 to get 1kHz PWM signal. EDIT: Using a workaround with limited frequency range here in the awLedcSetup and awLedcReadFreq functions. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
- This version (2.0.9) removes the existing fix for [#5050](espressif/arduino-esp32#5050) because ESP32 2.0.0-rc2 or newer already includes a [solution](espressif/arduino-esp32@65eafd1). - Constant strings now use program memory instead of ram by using `Serial.print(F())`function.
ESP32-S2 PWM settings do not work as expected.
The code bellow when run on an ESP32 WROOM Development board, generates 1ms and 2ms pulses at 50hz, works as intended. It correctly produces a pulse to control a servo that shifts between 1m2 and 2mS.
When the above code is run on a ESP32-S2 Saola board the pulse produced is not correct, it has a period of circa 1500mS and periods of 80mS and 160mS.
If in the code I change PWMFreq from 50 to 4096, I end up with a pulse that is 1ms to 2ms @ 50hz on the ESP32-S2.
The text was updated successfully, but these errors were encountered: