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
Implement analogWrite in ESP8266 port #708
Comments
Here is a start on important reference materials:
|
If you look at the STM32 jshardware.c you'll see Espruino can use Assuming the util timer stuff actually works, that could be a nice easy way to get PWM :) |
A first pass at PWM support through hardware was added and committed. Unfortunately, it does not yet work ... (but since hardware PWM didn't work previously, I don't believe we have regressed). When hardware PWM is engaged, we end up with a watchdog timer firing. I don't know yet what might be going wrong. A couple of suspicions:
|
Any progress on this?
So i guess, either investigate if we can somehow work without the hw_timer functionality, or the esp8266 is soft-pwm only for espruino. |
It sounds like PWM support may in fact be software only anyway? Espruino itself has a soft PWM implementation based on the Utility timer. Since @tve has added the Utility Timer support (probably using hwtimer?) it should be pretty easy to just use that instead - it's just a few lines from |
Ditched hardware PWM for now as it was broken (ifdef'd out). Now using software PWM: cb0232b |
As we study Espruino further, we have reached the point in investigating Pulse Width Modulation (PWM). This appears to drive the hardware specific function called
jshPinAnalogOutput
which is not implemented in the ESP8266 port of Espruino. The purpose of this Issue is to track a design, implementation and considerations to make that area of the function work.The text was updated successfully, but these errors were encountered: