> that subject isn't very informative! My problem is that I'm using the > PWM output to control the rate of charge of some batteries and I'm > monitoring the current into the batteries by measuring the voltage > across a 1/2 Ohm resistor is series with the batts, the problem is the > PWM output is controlling the current by high speed switching and is > interfering greatly with the numbers on the A2D input, I've tried > basically filtering it out using diodes and caps but it doesn't work > well and I have to use a long median average routine from many samples > to get half decent numbers for the current flow. Don't try to smooth the voltage on the resistor, filter it after it's gone thru a buffer or something. Since you want the average, the right low pass filter should work fine. Additional filtering in software is still a good idea anyway, but you have to get rid of the high frequencies externally. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body