The PIC16F819 datasheet shows hookup & a code example in the Timer1 section.