If you have the 8 RAM locations available, create an averaging scheme I
call a "bucket with a hole in it". Everytime a new value is read, install
it into the buffer, and DELETE the OLDEST value. This creates a long-term
average of 1.6S (ea reading at 200ms) and it will cleanup the lower bits
nicely.
--Bob
At 12:15 PM 8/21/2003 -0500, you wrote:
{Quote hidden}>I have a P-I temperature controller using a PIC 16f877. There is apparent
>random noise on the least significant 2 or 3 bits of the thermistor sensor
>connected to the 10-bit A/D. At least random as it appeared on my
>spreadsheet. I am using a 200ms sample rate.
>
>How can I software filter this noise without losing the least significant
>bits of the A/D?
>
>I do not have a black-belt in math so I was thinking about something simple
>like:
>Avg=Avg + (Sample-Avg)/k
>
>This would be simple to implement if k is a power of 2, however, this
>appears to lose accuracy.
>
>Thanks in advance for any tips or suggestions,
>
>-Ed
>
>--
>
http://www.piclist.com hint: The list server can filter out subtopics
>(like ads or off topics) for you. See
http://www.piclist.com/#topics
--------------
Bob Axtell
PIC Hardware & Firmware Dev
Tucson, AZ
1-512-219-2363
--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics