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.
Bookmarks