Pulse-width Modulation (PWM)

Nine of the WM2000’s general-purpose I/O lines — GPIO0 through GPIO8 — can work as pulse-width modulation (PWM) outputs.

All nine channels share the same clock, which is set to 2MHz and is not user-configurable.

For each PWM channel, you can independently set:

  • Channel frequency in the 30Hz ~ 20KHz range, with 16-bit resolution
  • The duty cycle from 0 to 100 percent, with 16-bit resolution

As explained in General-purpose I/O Lines, GPIO1 and GPIO3 can only source or sink up to 1mA of current. Due to this limitation, if you plan on using these GPIOs for PWM, you will need to add external buffers.

PWM channels are controlled via the pwm. object, which is documented in the TIDE, TiOS, Tibbo BASIC, and Tibbo C Manual.