PIC16F690 in Half-Bridge mode

Status
Not open for further replies.

Mithun_K_Das

Advanced Member level 3
Joined
Apr 24, 2010
Messages
899
Helped
24
Reputation
48
Reaction score
26
Trophy points
1,318
Location
Dhaka, Bangladesh, Bangladesh
Visit site
Activity points
8,254
I'm using PIC16F690 to drive a Half-Bridge. So far, I've generated the pulses with death time delay. But can't find any option to control the operating frequency and duty cycle. Can anyone help me in this case?
 

For Half Bridge mode, you use the CCP1 module and control through the CCP1CON register. The frequency is set by PR2. The duty cycle is set by CCPR1L.

Hope this helps.
Tahmid.
 

Thank you Tahmid. I did this program to check it.
Code:
int i;
void main() 
{
 TRISC = 0x00; // all out
 PR2 = 0x65; // clock frequency 19.61KHz
 CCP1CON = 0b10001101;
 PWM1CON = 0b10000111;

 while(1)
 {
   for(i=-5;i<86;i++)
   {
    CCPR1L = i;
    Delay_ms(20);
   }
   Delay_ms(500);
   for(i=86;i>-5;i--)
   {
    CCPR1L = i;
    Delay_ms(20);
   }
   Delay_ms(500);
 }
}

I found that frequency is changing with duty cycle. Why?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…