Introduction - If you have any usage issues, please Google them yourself
This example application demonstrates the use of a general purpose timer in down edge count mode. Timer 4 is configured to decrement each time a rising edge is seen on PM0/CCP0. The count is initialized to 9 and the match is set to 0, causing an interrupt to fire after 10 positive edges detected on the CCP pin.