PWM Period

The PWM period is specified by the TxPR register. The PWM period can be calculated using the formula of Figure 1. It is required to have FOSC/4 as the selected clock input to the timer for correct PWM operation.

Figure 1. PWM Period
PWMPeriod=[(T2PR)+1]4Tosc(TMR2PrescaleValue)
Note: TOSC = 1/FOSC

When TxTMR is equal to TxPR, the following three events occur on the next increment cycle:

Important: The Timer2 postscaler has no effect on the PWM operation.