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.

MSP430F5172: MSP430f5172

Part Number: MSP430F5172


Hello, 

I am using MSP430F5172 for running a buck converter. I want to be able to set the duty cycle to zero to shut down the converter. I was initially having trouble bringing the duty cycle to zero by using mode 5 (reset mode). 

However, setting the period to zero changing and the duty cycles  to zero using output mode 5 helped to the pwm signals to zero, but I can still see that there is some glitch in the transitions. It seems like the pwm signal continues to output the last value it had when it is operating at a duty cycle other than zero , 

Am I using the correct approach for setting both the duty cycles to zero?

Is there a reference code or a mode that I should operate at to make sure that both the high side and low side FETs are off all the time  when duty is zero?

void main()

{

// while loop in main code

while (1){
D_buckH= 152;
D_buckL= 153;

SetPWM(T_buck, T_boost);
SetDuty_Buck (D_buckH, D_buckL);
i = 100000; // Delay
do (i--);
while (i != 0);

SetPWM(0, T_boost);
OffBuck(0,0);
i = 100000; // Delay
do (i--);
while (i != 0);

__delay_cycles(10); // Delay between sequence convs
}

void OffBuck(unsigned int dH,unsigned int dL){

TD0CCTL1 |= OUTMOD_5 + CLLD_2; // CCR1 toggle/reset
TD0CCR1 = dH; // CCR1 PWM duty cycle of 1000/2000 = 50%
TD0CCTL2 |= OUTMOD_5 + CLLD_2; // CCR2 toggle/set
TD0CCR2 = dL; // CCR2 PWM duty cycle of 500/2000 = 25%
TD1CTL0 |= MC_3 + TDCLR; //up/down mode, clear TDR

}

  • TD0CCTL1 |= OUTMOD_5 + CLLD_2; // CCR1 toggle/reset

    How does SetPWM set OUTMOD? This "|=" may not be doing what you expect. Try instead:

    TD0CCTL1  = OUTMOD_5 + CLLD_2; // CCR1 toggle/reset

    -----

    If you want to stop the PWM Right Now, try using:

    > TD0CCTL1 = OUTMOD_0 | (0*OUT);    // Constant low immediately

**Attention** This is a public forum