I'm using Darrel's sspwm.inc program to generate a 2khz pwm signal which works very well. I now need a speedometer function. I have an incomming square wave pulse train from the vehicle speed sensor which pulses at approx 4000/minute at 60mph.

I have spare adc inouts so i was looking at a simple rc filter and measuring a cap voltage. Or i could use a freq to voltage ic LM2907 etc but i don't really want another ic on the board. So can I use ccp without access to timer1 as that's used by sspwm.inc.

I probably can't use count or pulsin for the same reasons, the software pwm must continue in the background and the hpwm is already in use generating a 20khz signal.

Any Ideas?