This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using comparator to force PWM output to 0 - Output taking several us to catch up

Hi.

I'm using tgeTMS320F28035PNT which comes with the isolated control card (CC2803X ISO DIMM Rev 1.3.

Tool is Code Composer Studio 6.1.1.00022 

I am configuring the PWM to be forced low when comparator 3 goes high. Everything seems to work fine, except the outputs take many microseconds to go to 0. At first I thought I was configuring the system to go to high impedance, but that doesn't seem to be the case. Here's my code:

	EALLOW;
	Comp3Regs.COMPCTL.bit.COMPDACEN  =0x1;	// Enable comparator block
	Comp3Regs.COMPCTL.bit.QUALSEL 	 =0x0;	// 1 clock cycle before triggering event
	Comp3Regs.COMPCTL.bit.SYNCSEL    =0x0;	// asynchronous version of the COMP signal is passed to the EPWM/GPIO module
	Comp3Regs.COMPCTL.bit.CMPINV     =0x0;	// Output of the comparator is passed directly
	Comp3Regs.COMPCTL.bit.COMPSOURCE =0x0;	// inverting input of the comparator is connected to the internal DAC
	Comp3Regs.DACVAL.bit.DACVAL		 =512;	// set DAC input to peak trip point

	AdcRegs.COMPHYSTCTL.bit.COMP3_HYST_DISABLE = 0x1;	//hysteresis disabled

// One shot latching protection
	EPwm1Regs.DCTRIPSEL.bit.DCAHCOMPSEL = DC_COMP3OUT; //Compare high linked to comparator 3
	EPwm1Regs.TZDCSEL.bit.DCAEVT1 = TZ_DCAH_HI;		 //0x2
	EPwm1Regs.DCACTL.bit.EVT1SRCSEL = DC_EVT1;		 //0x0
	EPwm1Regs.DCACTL.bit.EVT1FRCSYNCSEL = DC_EVT_ASYNC;//0x1
	EPwm2Regs.DCTRIPSEL.bit.DCAHCOMPSEL = DC_COMP3OUT; //Compare high linked to comparator 3
	EPwm2Regs.TZDCSEL.bit.DCAEVT1 = TZ_DCAH_HI;		 //0x2
	EPwm2Regs.DCACTL.bit.EVT1SRCSEL = DC_EVT1;		//0x0
	EPwm2Regs.DCACTL.bit.EVT1FRCSYNCSEL = DC_EVT_ASYNC; //0x1

	
	EPwm1Regs.TZSEL.bit.DCAEVT1 = 0x1;	//One shot enable of trip zone for epwm1
	EPwm2Regs.TZSEL.bit.DCAEVT1 = 0x1;	//One shot enable of trip zone for epwm2

// What do we want the OST/CBC events to do?
	EPwm1Regs.TZCTL.bit.DCAEVT1 = TZ_FORCE_LO; // 0x2 EPWMxA will go low
	EPwm2Regs.TZCTL.bit.DCAEVT1 = TZ_FORCE_LO; // 0x2 EPWMxB will go low
	EDIS;
	//clear any spurious trips
	EPwm1Regs.TZCLR.bit.OST=1;
	EPwm1Regs.TZCLR.bit.DCAEVT1=1;
	EPwm2Regs.TZCLR.bit.OST=1;
	EPwm2Regs.TZCLR.bit.DCAEVT1=1;

With this configuration the outputs look like this:

Yellow trace is the comparator input, and the remaining traces are two of my pwm outputs (the blue is not switching at that point, but that's ok). It looks like the outputs are going into high impedance instead of being forced low. Any suggestions on how to fix this so that the output goes "instantly" to 0?

Thanks in advance.