Mosaic
Well-Known Member
Hi:
I'm looking at the data sheet and I find that :
1) The PR2 register sets the frequency based on Fosc (8Mhz in my case)
2) The Pulse width is based on the (CCPR2L : ccp2con (5:4)) * Tmr2 prescale / 8Mhz
3) The duty cycle is based on ( CCPR2L : ccp2con (5:4))/(4(1+PR2))
So it seems I cannot alter the duty cycle without also either altering the frequency (PR2) or the pulse width (CCPR2L : ccp2con (5:4))
Is this correct? Duty cycle change forces a change to the pulse width or a change to the frequency?
If so then I have to do s'ware PWM to alter the duty cycle BY ITSELF.
I'm looking at the data sheet and I find that :
1) The PR2 register sets the frequency based on Fosc (8Mhz in my case)
2) The Pulse width is based on the (CCPR2L : ccp2con (5:4)) * Tmr2 prescale / 8Mhz
3) The duty cycle is based on ( CCPR2L : ccp2con (5:4))/(4(1+PR2))
So it seems I cannot alter the duty cycle without also either altering the frequency (PR2) or the pulse width (CCPR2L : ccp2con (5:4))
Is this correct? Duty cycle change forces a change to the pulse width or a change to the frequency?
If so then I have to do s'ware PWM to alter the duty cycle BY ITSELF.