Skip to content
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 stopped working #1303

Closed
MayaPosch opened this issue Dec 21, 2017 · 4 comments
Closed

PWM stopped working #1303

MayaPosch opened this issue Dec 21, 2017 · 4 comments

Comments

@MayaPosch
Copy link
Contributor

With a pre-3.4.0-release build of Sming, the PWM functionality (using the new PWM lib) was working properly. With current develop builds this functionality seems hopelessly broken. After trying with current develop branch on both Windows (WSL, Ubuntu 16.04) and Linux (Mint 18.x), the same result:

PWM frequency set to 1 kHz, duty set to 0%: 0V on output pin.
PWM frequency set to 1 kHz, duty set to >0%: 3.3V on output pin, no PWM.

Compiling the same application code using the aforementioned Sming build results in the pin output being as expected.

I first looked at the PWM library itself, trying to use the NMI timer instead of TIMER1: StefanBruens/ESP8266_new_pwm#18

Did something change in Sming with regard to timer usage that would prevent the PWM library from using either timer? The behaviour which I am observing is apparently due to the PWM library being unable to use the selected timer, causing digital output instead of PWM.

@slaff
Copy link
Contributor

slaff commented Jan 12, 2018

That is probably related to this change: c2cc852#diff-95f5a43cb31a804075bd87e65b4be18aR249

which finally activates your change:

d408e7d#diff-95f5a43cb31a804075bd87e65b4be18a .

Before that the compiler directive -DSDK_PWM_PERIOD_COMPAT_MODE=1 was not really added to the compiler arguments.

@MayaPosch
Copy link
Contributor Author

I was pretty sure that I had recompiled Sming without the parameter to the PWM library. Maybe I made a mistake there, though.

Regardless, the PWM library is supposed to still work no matter its configuration. The behaviour which I'm seeing is that the PWM library fails to acquire any timer. Something which might also be due to the new SDK compatibility?

@perpernorbi
Copy link
Contributor

This will fix it: #1433

@MayaPosch
Copy link
Contributor Author

Confirmed fixed with #1433.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants