> I need to be able to round off the square wave coming from the HWPM on my > PIC. The HPWM output is being used to generate sound. I am currently using > the standard 2 Rs + 2 caps which works in a fashion but is still rather > harsh. The freq range is potentionaly from 247 hz up to 12.5 kHz so an > active filter is needed (I think). Can any body point me in the right > direction? You shouldn't need an active filter, at least with a 20MHz PIC. In fact, you probably don't need much filtering at all. A 20MHz PIC can do 8 bit resolution PWM at 78KHz. That's over 6 times the highest frequency of interest, and certainly higher than anyone can hear. A passive two pole filter with both poles at 17.7KHz (half octave above 12.5KHz) will attenuate the PWM frequency by about 25dB. Note that all the PWM frequencies are well above the audible range, so the only reason for filtering is so that downstream active electronics doesn't do strange things due to the high out of band frequency content. Most decent amplifiers will have a low pass filter right on the input anyway, but I agree that filtering and buffering it yourself is a good idea. The "quality" of the sound is much more a function of the PWM resolution and the quality of the function to create the output samples. Doing a sine, for example, on the fly is too much for a simple PIC. This is best done with a lookup table. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- 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