Tool/software: Code Composer Studio
Hello,
I have a problem with the EPWM library regarding the phase shifting... I set the PWM and it´s working fine but when I try to set a phase shift, it doesn´t work, I need to set a new counterbase so it works...
//Here I have my PWM initialization, setting the period, etc. // // configure PWM 1 as master and Phase 2, 3 as slaves and let it pass the sync in pulse from PWM1 // EPWM_disablePhaseShiftLoad(VIENNA1_DRV_EPWM_BASE); EPWM_setSyncOutPulseMode(VIENNA1_DRV_EPWM_BASE, EPWM_SYNC_OUT_PULSE_ON_COUNTER_ZERO); EPWM_enablePhaseShiftLoad(VIENNA2_DRV_EPWM_BASE); EPWM_setSyncOutPulseMode(VIENNA2_DRV_EPWM_BASE, EPWM_SYNC_OUT_PULSE_ON_EPWMxSYNCIN); EPWM_setPhaseShift(VIENNA2_DRV_EPWM_BASE, 0); EPWM_setCountModeAfterSync(VIENNA2_DRV_EPWM_BASE, EPWM_COUNT_MODE_UP_AFTER_SYNC); EPWM_setTimeBaseCounter(VIENNA2_DRV_EPWM_BASE, 2000); //Although PhaseShift is set to 0, because of base counter I have a phase shift. EPWM_setSyncOutPulseMode(VIENNA3_DRV_EPWM_BASE, EPWM_SYNC_OUT_PULSE_ON_EPWMxSYNCIN); EPWM_setCountModeAfterSync(VIENNA3_DRV_EPWM_BASE, EPWM_COUNT_MODE_UP_AFTER_SYNC); EPWM_enablePhaseShiftLoad(VIENNA3_DRV_EPWM_BASE); EPWM_setPhaseShift(VIENNA3_DRV_EPWM_BASE, 2000); // I set the PhaseShift but it´s not working at all...
Could you help me, please?
Thank you very much.
BR,
Luis