Other Parts Discussed in Thread: C2000WARE
Hello, I don't know how to stop "ePWMx" in "Idle" mode by forcing the output pins to zero and how to synchronize a phase-shift delay.
Can anyone help me ?
Bellow is my code :
1- In "B" active task, I run,
CLK_enablePwmClock(myClk, PWM_Number_1);
CLK_enablePwmClock(myClk, PWM_Number_2);
CLK_disableTbClockSync(myClk);
initEPWM1();
initEPWM2();
==> in this routine, the phase-shift is imposed as follows :
//
// Set-up TBCLK
//
PWM_setPeriod(myPWM2, EPWM_PERIODE);
PWM_setSwSync(myPWM2);
PWM_setSyncMode(myPWM2, PWM_SyncMode_EPWMxSYNC);
PWM_setPhase(myPWM2, PhShift);
PWM_setCount(myPWM2, PhShift);
PWM_setSocAPulseSrc(myPWM1,PWM_SocPulseSrc_CounterEqualZero);
PWM_setSocAPulseSrc(myPWM2,PWM_SocPulseSrc_CounterEqualCmpAIncr);
==> the phase shift does not start at the same time during the infinite loop sequence.
CLK_enableTbClockSync(myClk);
2- In "C" active task, I run,
CLK_disablePwmClock(myClk, PWM_Number_1);
CLK_disablePwmClock(myClk, PWM_Number_2);
That's the only way I found to stop the PWM, but the ePWM outputs are in HIGH or LOW state randomly ==> I would like to set them to zero.
Many thanks in advance for your help.
Bruno