circuitpython/ports/mimxrt10xx/common-hal/pwmio
Jeff Epler 489163b74e mimxrt1011: pwmio: Enable basic PWMOut functionality
After this change, the following program works for me on the MIMXRT1010-EVK:
```python
import pwmio
import board

p = pwmio.PWMOut(board.D13, frequency=1_000_000, variable_frequency=True)
p.duty_cycle = 32868

while True:
    pass
```

Querying and varying the duty_cycle and frequency work as well.

The lowest frequency obtainable is about 2kHz; there is an additional
divider which would allow lower PWM frequencies (I think 1kHz is important
for servos?)

Something odd happens with very low duty cycles, such as
```python
>>> p.frequency = 2000
>>> p.duty_cycle = 2
```
instead of a symmetrical waveform, it's asymmetrical.  With `duty_cycle=4`,
the effect disappears.  The reason for this is probably hidden in the
datasheet, but could affect servos or other things that count pulse
widths.
2021-04-01 10:06:59 -05:00
..
__init__.c Fix copy pasta and stub build 2020-08-21 11:17:42 -07:00
PWMOut.c mimxrt1011: pwmio: Enable basic PWMOut functionality 2021-04-01 10:06:59 -05:00
PWMOut.h mimxrt1011: pwmio: Enable basic PWMOut functionality 2021-04-01 10:06:59 -05:00