It's not really a parameter in that sense, it's more like a side effect of the relationship between the oscillator frequency and PWM frequency. The closer they are in relation to each other the less resolution you get - it's just the way it works.
Basically, all it is a counter driven by the oscillator. The PWM period is set by telling a comparator at what count to "start over". If the counter is clocked at 1MHz and you tell it start over at the value 100 then the PWM frequency would be 1000000/100=10000Hz. If you tell it start over at 10000 the PWM frequency becomes 1000Hz and so on. This is what the PTPER value does.
The PWM output is set at the start of the PWM cycle and reset when the counter equals the dutycycle value. Now I Think you can see that when the PWM frequency in the example above is 1000Hz ther resolution will be 10000 "steps" while when the PWM frequency is 10000Hz the resolution will be 100 "steps". It's just the way a digital PWM generator works.
As for your ripple, make sure you have decoupling capacitor(s) as close to the supply pins of the PIC as possible. If the PIC has more than one pair of supply pins make sure they are all connected and properly bypassed.
/Henrik.
Bookmarks