> Now, since I want to smooth out any jitter in the tach pulse signal, I > average out the most recent 20 pulses. I have a CCP1 interrupt function > that populates a 20-element array with the value of the CCP1 capture > register. Once that array is full, I average the values in the array and > use that number as the pulse width. You could adjust or eliminate this > based on how many teeth you have on your tach pickup, how fast you want it > to respond to changing RPM, etc. I see no reason why this won't work as you intended, but I think there are better strategies. Why is a box filter better than a single or double pole filter? The latter require much less state and are easy to compute, especially if the filter fractions are 2**-N. This can usually be the case when all you want to do is get rid of some high frequency noise. If you are going to use a box filter, why not 2**N samples so that the divide to find the average turns into a right shift? Another observation is that you are doing the filtering on the periods. The speed value probably has a more predictable dynamic range, making single pole low pass filtering easier there using fixed point. In short, I would convert each period to its speed value, then low pass filter the speed values. If you don't need a new speed reading as each tooth goes by, you can set up the timer 1 prescaler to give you only every Nth pulse. I doubt you really need 1 part in 6M. ******************************************************************** Olin Lathrop, embedded systems consultant in Littleton Massachusetts (978) 742-9014, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu