There's an example of using the capture module in this thread
to measure high/low pulse width, and period;
http://www.picbasic.co.uk/forum/showthread.php?t=6719