Quote Originally Posted by penelopepug View Post
However I am not sure this is the source of the problem. I did look at the output of the pot and it is perfectly clean with and without the capacitor. It seems to be related to the anolog sampling or calculation (I think).
The problem probably stems from the fact that you are most likely updating the duty cycle in the middle of performing a cycle. The datasheets talk about that sort of thing. What happens if you just run the program in a loop that doesn't change the duty cycle?
As far as the A/D output, are you sure the A/D output (the number returned by the ADCIN command) is smooth in the first place? Maybe a 10ms pause isn't enough (not likely), maybe too much. Add in a bit of code to average out the duty cycle itself, software averaging of some sort, move the duty cycle around 'slower'...see what happens.

And as far as CMCON goes, just POKE the value into the appropriate register and see what happens.