Hi,
I do not understand the relation of TMR2IF being set with the CCP1 going high in the PWM Mode. Honestly speaking I am less experienced with the 16 series. However the PWM modules should work in the same way
As far as I understand:
TMR2IF is only set when TMR2 rollsover. In PWM that cannot happen if PR (period register is less than 255) or the duty cycle is less than 100%. Cause the PR match resets TMR2 -- CCP-PWM output = high, CCPR register match (concatenated with 2 bit internal Q clock of the prescaler) clears it.
Correct me if I am wrong.What you say is true when compare mode is used, not PWM mode.
Now coming to your problem.
It seems you would be driving a half bridge using the PWM
You can always use the compare mode to generate upto 16 bits of PWM and steer the outputs in the ISR as per your own requirement.
Your nickname gives me a hunch that you are from Kolkata India and your full name is Sudip Mukherjee . If that is true then welcome to this great place which actually helped me gain confidence and little expertise in PIC.
Bookmarks