PIC16F877A Timer2 tutorial
The Timer2 module is an 8-bit timer/counter within most PIC MCU devices. Timer2 can increment up to a value of 255 before it overflows back to zero. Timer2 has other built-in features that make it very useful for many different applications.