Hi
I am using a full bridge and that is why i want four pins to control it. What i am doing is :- set the chip in PWM mode, made PR2 = 200 and CCPR1L is the duty cycle and also made TMR2IE=1. So whenever TMR2 matches CCPR register the CCP Pin goes low and then again when TMR2 mathes PR2 - 1) CCP pin goes high, 2) TMR2 rollsover, and 3) TMR2 interrupt is generated.It seems you would be driving a half bridge using the PWM.
Anyway , can u please give me a litle idea about how to use the compare mode to generate PWM. I tried it initially , but whenever the duty cycle is getting small , it was not giving good result , so i thought of switching to PWM mode.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.
You are absolutely right about my name and location . I am from south kolkata (hazra).
Regards
Sudip Mukherjee
Bookmarks