Check you PIC datasheet, some have built-in counter. This allow you to use them to count the incoming pulses for a x sampling time.
A while back i've made this one
http://www.picbasic.co.uk/forum/showthread.php?t=1044
Maybe this could be handy for you. It use TIMER0
Bookmarks