Pulse Width Modulators

The default BIOS configuration table defines four dedicated PWM outputs as PWM_0, PWM_1, PWM_2, and PWM_3, each with programmable frequency and duty cycle.

The table below shows examples of hardware (register) based PWM programming.

The PWM variables that control frequency and duty cycle are controlled by the BASE_UNIT_INT, BASE_UNIT_FRAC, and ON_TIME_DIVISOR register settings and the following equations:


PWM frequency formula:



PWM duty cycle formula:



Note: Consult specific operating system documents if manipulating PWM settings at the OS level.

PWM Programming examples

Item Example 1 Example 2 Example 3
Integer part of BASE_UNIT_INT (bits 29:22) 0000_0000b 0000_0000b 0000_0000b
Fractional part of BASE_UNIT_FRAC (bits 21:8) 00_0100_0000_0000b 00_0010_0000_0000b 00_0001_0000_0000b
Decimal base unit value 0.0625 0.03125 0.015625
ON_TIME_DIVISOR (bits 7:0) 0000_1000b 0000_0100b 0000_0001b
Base unit type fractional fractional fractional
PWM frequency (Hz) 4,688 2,344 1,172
PWM period (usec) 213 427 853
Duty cycle 50% 50% 50%


See also: Pulse Width Modulators in the Expansion Board Hardware Datasheet.

For more complete information about compiler optimizations, see our Optimization Notice.