Timer2 is an 8-bit timer which operates in a specific way.
Pulses generated by the quartz oscillator first pass through the prescaler the rate of which may be changed using the T2CKPS1 and T2CKPS0 bits. The output of the prescaler is then used to increment the TMR2 register starting at 00h. The values of TMR2 and PR2 registers are compared all the time and the TMR2 is constantly incremented until it matches the value stored in PR2. When the match occurs, the TMR2 register is automatically cleared. The Timer2 postscaler is incremented on every match and its output is used to generate an interrupt if enabled.
The TMR2 and PR2 registers are both readable and writable. Counting may be stopped by clearing the TMR2ON bit, thus reducing power consumption.
The moment of the Timer2 reset may also be used as a serial communication clock signal.
The operation of the Timer2 is under control of several bits of the T2CON register.
TOUTPS3 - TOUTPS0 - Timer2 Output Postcaler Select bits are used to determine the postscaler rate according to the following table: