4.3 PWM Period
The PWM period is specified by the T2PR register of Timer2. The PWM period can be calculated using the formula in Equation 4-1.
PWM Period=[(T2PR + 1)]•4•TOSC•(TMR2 Prescale Value)
where:
TOSC = 1FOSC
When T2TMR is equal to T2PR, the following three events occur on the next increment event:
- T2TMR is cleared.
- The CCPx pin is set. (Exception: If the PWM duty cycle = 0%, the pin will not be set.)
- The PWM duty cycle is transferred from the CCPRx register into a 10-bit buffer.
Important: The Timer postscaler is not used in the
determination of the PWM frequency.