Other Parts Discussed in Thread: TMS320F28379D,
Hey guys
I have a problem with creating deadtime in CCSv6.
The code bellow generating a three-level waveform, but I cannot add a delay or deadtime on it, by using DELAY_US(). what can I do about it?!
I don't wanna use EPWM modules due to a couple of reasons,
Thanks in advance
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
interrupt void cpu_timer0_isr(void)
{
realtime_sin=(0.9*(sin(0.00314*cnt)));//sin(2*3.14*50Hz*(cnt/100kHz));50Hz frequency shabake, 100khz frequency har intruppt.
////////////////////////////////////////////////////////////////////////////
if(cnt1<25)
{
realitime_triangle1=((float)(0.04*(cnt1)));
}
if(cnt1>24)
{
realitime_triangle1=((float)((-0.04*(cnt1))+2));
}
/////////////////////////////////////////////////////////////////////////
if(realtime_sin==0)
i++;
if((i%2)==0)
{
C=1;
NC=0;
}
else
{
C=0;
NC=1;
}
/////////////////
if(realtime_sin>realitime_triangle1)
{
B=1;
NB=0;
}
else
{
B=0;
NB=1;
}
///////////////////Gate signals//////////////////////////
LP1=(B & C);
LN1=(B & NC);
EALLOW;
GpioDataRegs.GPADAT.bit.GPIO1 = LP1;
EDIS;
EALLOW;
GpioDataRegs.GPADAT.bit.GPIO7 = LP1;
EDIS;
EALLOW;
GpioDataRegs.GPADAT.bit.GPIO3 = LN1;
EDIS;
EALLOW;
GpioDataRegs.GPADAT.bit.GPIO5 = LN1;
EDIS;
cnt++;
cnt1++;
if(cnt>999)
cnt=0;
if(cnt1>49)
cnt1=0;
///////////////////////////////////////////////////////
// Acknowledge this interrupt to receive more interrupts from group 1
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}
