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.

CCS/RM46L852: Synchronize EPWM with external signal

Part Number: RM46L852
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Good morning,

I want to synchronize a 600Hz pwm, with an external 60Hz signal, coming from the electrical network.

So I configured the etpwm module to generate a 600Hz output and enable Het1_16, as a synchronization input (EPWM1SYNCI), but I can't get the signals to synchronize

I attach images:

1.- Configure the multiplexing of pins

Here is something to be modified?

Signals not syncing

Code:

void TreePhaseInit() {
etpwmDeadBandConfig_t Set_DBand; // declaracion de variable
/*Configuracion de la banda muerta*/
Set_DBand.halfCycleEnable = false;
Set_DBand.inputmode = PWMA_RED_PWMB_FED;
Set_DBand.outputmode = PWMB_FED_PWMA_RED;
Set_DBand.polarity = Invert_PWMB;

etpwmInit();
/*Configuracion del angulo de desfase entre los PWM generados*/
etpwmSetSyncOut(etpwmREG1, SyncOut_EPWMxSYNCI);

etpwmDisableCounterLoadOnSync(etpwmREG1);

/* Set the time period as 1000 ns (Divider value = (1000ns * 2MHz) - 1 = 89)*/
etpwmSetTimebasePeriod(etpwmREG1, 3333U);

/* Configure Compare to register 1 */
etpwmSetCmpA(etpwmREG1, 3333 / 2);
etpwmSetCmpB(etpwmREG1, 3333 / 2);
/*Iniciando el control del modulo chopping de pwm*/
/*Iniciando la carga de los valor de la banda muerta 1000---> 510 microsegundos*/
etpwmSetDeadBandDelay(etpwmREG1, 1000, 1000);
etpwmEnableDeadBand(etpwmREG1, Set_DBand);

}

Attached complete program code:

2134.RM46_ETPWM_TRIFASICO_2017.rar

Please, I await your comments, maybe some configuration is missing!