Re: May be CCPRxH value resuts altered when enable and disable PWM mode
Improving some amplifier circuit connected to the PWM port, I need to use negated PWM at the port
I use a negated calculation for the PWM because the pcb was made and I have not seen the CCP3 for PWM was not ECCP and have not the posibility off negated output in CCP3CON
So I calculated and complement the value before copying to CCPR3L
With all the care to have no errors in calculations and setting high the PORTA,2 for the time the PWM be disabled, I have a full output (PORTA,2 = low) from the moment the PWM is re-enabled up to the end of current PWM cycle.
As CCPR3L is always OK at .255 or near level , the only way to have a wrong 0 value in CCPR3H is if some modification arises inside the pic when clearing or enabling CCPCON for pwm
I do a provisory (or permanent) patch: setting the TRIS bit before enabling CCP3CON and clearing TRIS bit after PWMcycle end. With the pull up it works fine
I can modify program and copy the value of CCPR3H after clearing, also after re-enabling pwm and save both values in EEPROM if there are not available information on the matter.
It will be usefull if this information be stated in the data sheet.
I didn´t found it.