"David E. Olson" wrote: > > Tony - I should have pinged you earlier - I knew you were working on > something like this. > > OK. You're basically doing period counting rather than explicit pulse > counting, which should be analogous. > > It certainly reduces the number of interrupts out there. > > > ; Interrupt routine may capture many speed values, > > ; but the capture registers are only read every 500mS > > ; for a display update. > > I'm not sure where you're reading the capture registers every 500ms. Your > ISR seems to be CCP related and not TMR related. In the main code loop, one of it's tasks is to read the capture registers every 500mS or so. The main loop time is controlled by TMR0 for a 50mS loop time. I count 10 of these loops, and then call SpeedCal to update the speed display. In my case it is displayed on a virtual headset via a 2.4GHz video link. Thus I can see where the vehicle is heading, and the speed at the same time. > If that's the case, then > your ISR is firing on every falling edge. Yes, but the capture registers are overwritten continuously, but mostly discarded, and TMR1 is reset as well so I can get the next capture. It works well so far from a sig gen. I got a 5V opto schmitt trigger device ($5 from RS) that 'looks' through the slots cut into the wheel rims. I get a nice square wave which is fed direct to pin RC2 with a pullup resistor. -- Best regards Tony http://www.picnpoke.com mailto:sales@picnpoke.com