Fix delays and rounding in samd PWM#9343
Conversation
tannewt
left a comment
There was a problem hiding this comment.
Thanks for the thorough testing and fixes.
I think the tools/pwm contents would be better hooked up in docs/ so that it ends up on docs.circuitpython.org OR as an Adafruit Playground writeup. In tools, it won't be very discoverable.
You can make the docs.cp.org contents with make html at the top level. It ends up in _build IIRC.
dhalbert
left a comment
There was a problem hiding this comment.
Another place to put the tests is in tests/circuitpython-manual. I'm not sure we should put the very detailed testing screenshots and discussion in the repo. I'd suggest putting it in this PR and putting a link to it somewhere with the tests.
|
|
For test documentation, seems like the repo issues and PRs are the defacto places for this, but I'll add some lines to the online docs for |
|
I shrank the PNG images by about 70% using https://tinypng.com, and pushed them. I see little if any visible change. |
dhalbert
left a comment
There was a problem hiding this comment.
I shrank the images, and will merge.
Blocking delays are observed when setting
duty_cyclein the samd port of CircuitPython (see #7653), behavior which interferes with some applications of PWM, and which differs from from that of other ports. Investigation of this issue revealed another problem: In some cases, the API will round a non-zero duty cycle down to zero, causing the PWM signal to stop cycling at all. The changes proposed in this PR address both of these issues.Detailed description of how these fixes were tested contains many plots and can be found in (https://github.com/timchinowsky/circuitpython/blob/fix-samd-pwm/tools/pwm/pr.md) and (https://github.com/timchinowsky/circuitpython/blob/fix-samd-pwm/tools/pwm/README.md).