pwm(8)

pwm8

Configure pwm (pulse width modulation) hardware

Usage

pwm [-f device] -C

pwm [-f device] [{-D | -E}] [-I] [-p period] [-d duty]

Overview

The pwm utility can be used to configure pwm hardware. pwm uses a pwmc(4) device to communicate with the hardware. Some PWM hardware supports multiple output channels within a single controller block; each pwmc(4) instance controls a single PWM channel.

pwmc(4) devices are named /dev/pwm/pwmcX.Y, where X is the controller unit number and Y is the channel number within that unit.

The options are as follows:

-f device

Device to operate on. If not specified, /dev/pwm/pwmc0.0 is used. If an unqualified name is provided, /dev/pwm is automatically prepended.

-C

Show the configuration of the PWM channel.

-D

Disable the PWM channel.

-d duty

Configure the duty cycle (in nanoseconds or percentage) of the PWM channel. Duty is the portion of the period during which the signal is asserted.

-E

Enable the PWM channel.

-p period

Configure the period (in nanoseconds) of the PWM channel.

-I

Invert PWM signal polarity

Examples

  • Show the configuration of the PWM channel:

    pwm -f /dev/pwm/pwmc0.1 -C
  • Configure a 50000 ns period and a 25000 ns duty cycle and enable the channel:

    pwm -f pwmc1.1 -E -p 50000 -d 25000
  • Configure a 50% duty cycle on the device and channel which were configured in pwmc(4) to have the label backlight:

    pwm -f backlight -d 50%

Releases

19 releases since FreeBSD 12.1-RELEASE; the text changed 6 times.

  1. 12.1
  2. 12.2
  3. 12.3
  4. 12.4
  5. 13.0
  6. 13.1–13.2
  7. 13.3–16.0

-I since FreeBSD 13.1-RELEASE.

History

The pwm utility appeared in FreeBSD 13.0.

Authors

The pwm utility and this manual page were written by Emmanuel Vadot ⟨[email protected]⟩.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.