summaryrefslogtreecommitdiff
path: root/tests/extmod_hardware/machine_pwm.py
AgeCommit message (Collapse)Author
2025-02-25tests: Four typos in tests directory.Christian Clauss
Found by codespell. Signed-off-by: Christian Clauss <cclauss@me.com>
2024-12-11tests/extmod_hardware: Add a test for machine.PWM freq and duty.Damien George
This adds a hardware test for `machine.PWM`. It requires a jumper wire between two pins, uses `machine.PWM` to output on one of them, and `machine.time_pulse_us()` to time the PWM on the other pin (some boards test more than one pair of pins). It times both the high and low duty cycle (and hence the frequency) for a range of PWM frequencies and duty cycles (including full on and full off). Currently supported on: - esp32 (needs a minor hack for initialisation, and some tests still fail) - esp8266 (passes for frequencies 1kHz and less) - mimxrt / Teensy 4.0 (passes) - rp2 (passes) - samd21 (passes for frequencies 2kHz and less) Signed-off-by: Damien George <damien@micropython.org>