espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.74k stars 741 forks source link

ESP32 - digitalPulse() not changing pulse width #2409

Open SimonGAndrews opened 10 months ago

SimonGAndrews commented 10 months ago

While attempting to use the servo module it seems most likely that the supporting Espruino function digitalPulse(0 is not working correctly on an ESP32 ( Firebeetle ESP32-E).

I have put a logic analyser on the pulsed pin and it seems the pulse width is always about 600us in response to a digitalPulse(D4,1,x) command no matter what the value of x. Where x should be the length of the pulse in milli seconds.

Please see supporting discussion at https://forum.espruino.com/conversations/389271/

SimonGAndrews commented 10 months ago

Happy to support with further testing , on different ESp32 boards and Espruino Pico if that helps.

gfwilliams commented 10 months ago

Thanks - very strange. And longer pulses don't work?

This could potentially be related to jstimer changes that went in a while ago, where we moved to using relative times rather than absolute for timer tasks. I guess we could test before/after to see if that's what broke it

SimonGAndrews commented 10 months ago

Thanks, Ok I’ll try a version pre that change and longer pulses. I will also check my measurement method with a pico.