-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
is there an issue in HW_pwm on the ESP8266? #2888
Comments
for completeness: this is my modified Basic_HardwarePWM
and this is the Arduino sketch:
With Arduino, I get nice fading of five+1 channels, with Sming HardwarePWM, not so much. |
confusing, if I add this line:
I get zero duty for all channels but 2 and 5,
5 is stuck at 500:
and 2, the LED_BUILTIN works as expected:
[edit: just noticed that this is out of sync, that's before the debug line is before the setDuty line in the code, so it always shows the next to be set but the current set. The results are as expected, though] Since the same code is executed for all pins, I can only think there's something wrong with the underlying configuration of the pins / pwm channels. At least, I feel that I might not be making some very stupid mistake here. I hope. |
this is with ENABLE_CUSTOM_PWM=1 btw. I'm still thinking I may be missing something here, after all, esp nonos has not been changed in a long while. |
really? This one drove me mad! I thought I had messed something up when moving to ConfigDB! |
hmm... seemed to work with the example I built but not with the full firmware yet. Will examine tomorro. |
@pljakobs can you get the latest Sming version and check if the fix is working for you? |
I'm testing, it does work for Basic_HwPWM, so I assume it fixes the bug. |
confirmed fixed, I had another issue in my own code that also made PWM not work. Thank you both! |
maybe just a sanity check:
I noticed that my LED controllers are stuck and the LED output doesn't change anymore.
I dug deep in my code but could not really find anything wrong - today, I compiled the Basic_PWM example, changed the pins to match my layout (but also tried it on a naked chip in a programmer) and while I could get the on-chip LED to dim up and down nicely, it seemed that none of the external pins did (tried 4, 5, 12, 13 and 14).
I checked with a scope and could see GPIO2 PWM'ing nicely but none of the others.
Looking at the HardwarePWM.cpp module, I can't see anything out of the ordinary there. I have tested the same hardware with a simple Arduino sketch driving the PWM pins using analogWrite and they work fine.
Could someone be so kind and double check this? I feel slightly insane right now.
Why would GPIO2 work and the others would not?
The text was updated successfully, but these errors were encountered: