Henrik,
Thanks for the information and ideas. You confirmed several things I was thinking.
I had an idea that I could up the oscillator speed and use PLL but wasn't sure. And in that regards, to enable my PLL, which of the following would I implement (or something else):
PLLEN = ON
or
OSCTUNE = %11000000
Secondly, I looked at my code again and I have the following line in my configuration section:
OSCCON = %11100010
Doesn't that indicate that my oscillator is already set to 8MHz? I was under the impression that I was configured for 4MHz, but again, I am the newbie at this.
Lastly, please let me know if the following lines would get me in the ballpark of what I would like to do... or if I have any idea of what is going on yet....
PR2 = 16 'pwm = 125000Hz (I changed my desired freq. PicCalc showed me that this freq would give me 256 steps to my pwm)
CCPR2L = 128 'duty at approx 50% (PR2*0.50)
TRISC.1 = 0 'make CCP2 output
T2CON = %00000100 'start timer2
CCP2CON = %00001100 'lowest duty bits and PWM on 2
.... and then I would manipulate the CCPR2L register to change the duty cycle.... no??....
Thanks again.
Bookmarks