-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
PWM Frequency Set Does/Might Not Work #902
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I use esp-open-rtos and multipwm_set_freq() works perfectly. I use 1KHz for max value. |
I spoke with the developer of |
@RavenSystem any solution? any value of "q" in JSON becomes 76Hz on PWM, I tested a lot of tries with oscilloscope |
FYI.
I'm working with the
multipwm
library of esp-open-rtos at the moment, porting it to ESP8266 RTOS SDK, and noticed themultipwm_set_freq()
doesn't actually do anything.https://github.com/RavenSystem/esp-homekit-devices/blob/master/devices/HAA/main.c#L4434
The actual frequency/period is set in the header with
#define MULTIPWM_MAX_PERIOD UINT16_MAX
multipwm_set_freq()
will cause the divider to be set toTIMER_CLKDIV_16
(see https://github.com/SuperHouse/esp-open-rtos/blob/master/core/include/esp/timer.h)So the frequency of the PWM calculates to about 76Hz. If a user selects a frequency > 100kHz, the divider will be
TIMER_CLKDIV_1
so the PWM frequency will be 1.22kHz.This is assuming the clock is running at 80MHz.
Is anyone able to confirm this?
The text was updated successfully, but these errors were encountered: