22.4.1 Standard PWM Operation

The standard PWM function described in this section is available and identical for all CCP modules.

The standard PWM mode generates a Pulse-Width Modulation (PWM) signal on the CCPx pin with up to ten bits of resolution. The period, duty cycle, and resolution are controlled by the following registers:

  • Even numbered TxPR registers (T2PR, T4PR, etc.)
  • Even numbered TxCON registers (T2CON, T4CON, etc.)
  • 16-bit CCPRx registers
  • CCPxCON registers

It is required to have FOSC/4 as the clock input to TxTMR for correct PWM operation. The following figure shows a simplified block diagram of the PWM operation.

Figure 22-4. Simplified PWM Block Diagram
Note:
  1. 8-bit timer is concatenated with two bits generated by FOSC or two bits of the internal prescaler to create 10-bit time base.
  2. The alignment of the ten bits from the CCPRx register is determined by the CCPxFMT bit.
Important: The corresponding TRIS bit must be cleared to enable the PWM output on the CCPx pin.