Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PWM generation using PIC Microcontroller and ECCP module for driving the Full Bridge

Status
Not open for further replies.

usama14

Member level 5
Joined
Oct 31, 2015
Messages
90
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
756
I want to drive the Full bridge configuration for the dc to dc converter. I want to use the two output PWMs from the microcontroller according to this 2.png

I also want to vary the duty cycle according to the change in the input voltage.
I'm using PIC18F4550. Also, I want to control Full bridge with two output PWMs from two pins, each driving one leg respectively. This is given in its datasheet at page#156.
ECCP module does say that I can drive it as I want to, But ECCP module is giving output in complemented form like this 1.png
I Have selected the driver ICs IR2110, they drive the pairs of low and high side. And the MOSFETs are N-type IRFP150N.
In a nutshell, I need 2 pwm signals, which are 180 degree out of phase with each other, and each one will drive a diagonal pair of fets with the same duty cycle......but indeed I need to have that dead time bit between the two pwms..This limits the duty cycle of each pwm to say 40% maximum.
The code that I've written is in xC8 compiler, is self explanatory and is given below:
Code:
#include<xc.h>
#define _XTAL_FREQ 4000000
void Initmain(){
PR2=0x04; // Frequency: 50KHz
CCP1CON=0b10001100;  // Half Bridge Forward; P1A, P1B active-high;
CCPR1L  = 0b00000001;  // Start with 20% Duty Cycle
ECCP1DEL=1;
TMR2=0;
TMR2IF=0;
T2CON=0b00000101;    // Postscale: 1:1, Timer2=On, Prescale = 1:4
while(TMR2IF==0);
TRISC=0;
PORTC=0;
TRISD=0;
PORTD=0;
//ECCP1AS=0b00000000;
ECCPASE=0;
P1M1=1;         //MUST WRITE THIS
}
void main(){
Initmain();
while(1)
{
}			
}
The output waveforms have different duty cycles, but I need the same on both of them.3.png I also tried making the dead band time to be variable with the equation (Td=0.5-Duty cycle), which should logically WORK but still the waveform gets rubbish.
Any help PLEASE as I'm really stuck in all this? :/
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top