9 Pulse-Width Modulation (PWM)

Note: For PWM that depends on TMR2, see the Capture/Compare/PWM (CCP) section.

The 16-bit PWM peripheral is fully stand-alone, meaning it does not utilize another system timer, unlike CCP, which depends on TMR2. There are five operating modes for generating PWM:

  • Left-Aligned
  • Right-Aligned
  • Center-Aligned
  • Variable Aligned
  • Compare

These modes change how the count is used to generate the output. Inside each instance are slices, each containing two outputs. The outputs share a mutual frequency but have their duty cycle registers. Additionally, the peripheral is double-buffered for smooth output changes and can synchronize with other PWM instances.