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

new pwm module (pwm2) #2667

Closed
fikin opened this issue Feb 14, 2019 · 1 comment
Closed

new pwm module (pwm2) #2667

fikin opened this issue Feb 14, 2019 · 1 comment

Comments

@fikin
Copy link
Contributor

fikin commented Feb 14, 2019

PWM for high frequency

Justification

I guess there is no need to justify why 1kHZ limit of current SDK provided PWM is not good enough.

Lately I've played with https://github.com/StefanBruens/ESP8266_new_pwm.
Its theoretical limit is 5MHz but I don't have equipment to confirm it.
With my (cheap) oscilloscope I can observe up to 50kHz and it seems correct.
Playing in smaller 1-5kHz range I haven't seen any duty cycle side effects either.
It would be great if someone can test it with better hw thought.
And I haven't tested with many pins, but that probably is only matter of time ;)

Stefan's library is for Arduino. I've adopted it as "pwm2" module for nodemcu.
https://github.com/fikin/nodemcu-firmware/tree/pwm2

The implementation is based around a driver, a header and lua bindings. Documentation has an example how that is programmed from lua pov.

Feedback is welcome!

Workarounds

Are there any? ;)

@nwf
Copy link
Member

nwf commented Feb 14, 2019

Thank you for your contribution to the NodeMCU ecosystem!

Please open a PR rather than an issue for review!

@fikin fikin mentioned this issue Feb 14, 2019
4 tasks
This was referenced May 6, 2019
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

Successfully merging a pull request may close this issue.

3 participants