Timer1 in the PIC16F877A is a 16-bit timer/counter, capable of counting up to 65535 pulses (0xFFFF). It operates in Timer or Counter mode