-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
Fix/pwm new #1433
Fix/pwm new #1433
Conversation
Conversions in pwm.c are bugous. Fix is already available for the original repository, but the merge request has not yet been accepted. See StefanBruens/ESP8266_new_pwm#26 for details.
@perpernorbi Please, fix the coding style
Make sure to read the release notes related to coding style: |
@MayaPosch can you check if that PR is working for you? |
Class HardwarePWM actually provides a function to query the maximum value of duty.
ENABLE_CUSTOM_PWM defaults to 1 since d870c27.
9d45675
to
826783e
Compare
@slaff I'll let you know tomorrow (Monday). Need to set up the infrastructure first before I can run a test :) |
@slaff Just tested the PR with my setup. Seems to have fixed the PWM issues. Also finally got the fine-grained control over the output now, with up to 0x6F (111) steps tested from 0 to nearly 3.3V with a DMM directly measuring the pin (GPIO14) in DC voltage mode. |
Fixes to the new PWM (SmingHub#1433)
HardwarePWM was not working, probably since custom pwm implementation has been set to default. The Basic_HwPWM sample is not working. All GPIO pins are at Vcc, the voltage on GPIO2 does not change.
The custom pwm implementation contains a bug. Converting duties and periods is malfunctioning. See StefanBruens/ESP8266_new_pwm#24 for details.
These changes correct the conversion in pwm.c (using .patches/pwm.patch). Also, minor refactoring has been done in samples/Basic_HwPWM.
To test the changes, build and deploy Basic_HwPWM, and verify voltages using a multimeter. Voltages should approximately be the same, regardless ENABLE_CUSTOM_PWM is set to 0 or 1.