by yonghui » Thu Aug 15, 2013 3:12 pm
if u are using timer 2 in PWM mode, do not change the PR value since PR2 value will determine the period of the PWM. PWM frequency normally is in Kilo Hertz range. the higher frquency u have, u will get lower resolution of PWM. u try to read the datasheet of PIC. CCPR2 registers value will determine your duty cycle.
you can use the timer 2 interrupt as counter, but do not simply change the PR2 value.
thanks®ards,
yh