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.

Equation 4-1. PWM Period
P W M P e r i o d = [ ( T 2 P R + 1 ) ] 4 T O S C ( T M R 2 Pr e s c a l e V a l u e )
w h e r e :
T O S C = 1 F O S C

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.