I used mega8 ADC to control duty cycle of pwm output but there is a little noise on pwm signal. I tried to reduce it using 100nf capacitor on inputs, there is caacitor on VCC. there is 1uf on AVref. the external crystal with its two capacitors are close to the mega. the noise increased when connect it to switch dc dc converter.I use the output voltage of the converter as analog input to the ADC of the mega, Is this the noise source?( because of ripple in dc converter) , How to reduce it?