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.

TMS320F28069M: STILL PWM PULSE AT CMPA = 0

Part Number: TMS320F28069M

Hello,

I would like to set PWM from 0% to 100% in up count mode. However, when I program CMPA = 0 i haven't 0 but still pulses appeared. If i still have some pulses then i will have current on IGBTs.

	// 	---------------------- Init EPWM n ------------------------------------------------
	(*ePWM[Base_Pwm]).TBPRD 		   			= period;     	    // Set timer period
	(*ePWM[Base_Pwm]).CMPA.half.CMPA            = CMPA;         //CompareA event at half of period
	(*ePWM[Base_Pwm]).TBCTL.bit.CTRMODE   		= TB_COUNT_UP;		// Symmetric wave
	(*ePWM[Base_Pwm]).TBCTL.bit.PHSEN     	    = TB_DISABLE;      	// Disable phase loading

	(*ePWM[Base_Pwm]).TBCTL.bit.HSPCLKDIV 		= TB_DIV1;          // Clock ratio to SYSCLKOUT
	(*ePWM[Base_Pwm]).TBCTL.bit.CLKDIV    		= TB_DIV1;			// SYSCLKOUT / 1
	(*ePWM[Base_Pwm]).TBCTL.bit.SYNCOSEL  		= TB_DISABLE; 		//TB_CTR_ZERO;			 Sync with Sync in signal
	(*ePWM[Base_Pwm]).TBCTL.bit.PRDLD 			= TB_SHADOW;		// Shadow load for PRD

	// Setup shadowing
	(*ePWM[Base_Pwm]).CMPCTL.bit.SHDWAMODE 		= CC_SHADOW;		// Shadow Mode
	(*ePWM[Base_Pwm]).CMPCTL.bit.SHDWBMODE 		= CC_SHADOW;		// Shadow Mode
	(*ePWM[Base_Pwm]).CMPCTL.bit.LOADAMODE 		= CC_CTR_ZERO;  	// Load A on Zero
	(*ePWM[Base_Pwm]).CMPCTL.bit.LOADBMODE 		= CC_CTR_ZERO; 		// Load B on Zero


	// Set Actions
	//(*ePWM[Base_Pwm]).AQCTLA.all                = 0x0024;       // Action-qualifiers, Set on CMPA, Clear on PRD

	EPwm1Regs.AQCTLA.bit.PRD = AQ_SET;      //  
	EPwm1Regs.AQCTLA.bit.CAU = AQ_CLEAR;    //  

if someboby can help me it will be great

Regards,

OL

  • OL, 

    Well, something is driving the PWM output high. I would try changing AQ actions to start and see if you can determine if one of those are at fault. Additionally the Tripzone could cause this behavior.

    Do you have any code which is capable of changing the CMPx values? I would recommend monitoring the values during execution.

    It might be helpful if you determine where in the PWM period the pulse is coming, this can be done by creating a synchronous GPIO toggle in a PWM ISR. 

    Regards,
    Cody 

  • Cody,

    Thanks for your answer. I perform some tests and i still have this pulse.Yes, i change in realtime in CCS the value of CMPA from 0 to the max 900 but nothing better.

    I will perform test using interrupt without ADC reading because in my config it perform interrupt @ the period of PWM when 16 adc conversions are finished. Perhaps, I have got a lag in PWM counter who a pulse.

    I will let inform

    regards,

    OL