> how are you doing a low pass filter in software ? > > maybe just point me in the right direction with the "extra 2 or 4 bits" part A single pole low pass filter is easy and fast in software. If NEW is a new reading and FILT is the filter value to update with the new reading then the algorithm is: FILT <-- FILT * (1 - W) + NEW * W where W is a 0 to 1 weighting fraction for the new value. This type of filter has the same response as an RC low pass filter with NEW as the input and FILT as the output. W determines the time constant of the filter if new values come in at regular intervals. Another way of looking at this filter is that the output is a weighted sum of all input values. The most recent input has a weight of W, the nextmost recent W**2, the next more recent W**3, etc. Or you could say that each new reading starts out with a weight of W in the filtered value, and decreases by W for each additional new reading. In other words, the impulse response is a step followed by an exponential decay. Computing such a filter is particularly easy if W = 2 ** -N where N is a positive integer. In this case, NEW * W is just NEW shifted right N bits. FILT * (1-W) is FILT shifted right N bits subtracted from FILT. Using C-like syntax, the algorithm is: FILT = FILT - (FILT >> N) + (NEW >> N) It is often useful to maintain FILT and N as fixed point values with N fraction bits to eliminate roundoff error. That's what I was alluding two with "extra 2 or 4 bits". ******************************************************************** Olin Lathrop, embedded systems consultant in Littleton Massachusetts (978) 742-9014, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.