Hi, I am trying to sychronize two PWM modules located at two F28M35 concerto cards. I use a master-slave approach to synchronize the pwm modules. The master controller run the application "PWM_sync_master" which basically sets up the PWM1 module for running in up-down mode and constant duty (50%). The SYNCO signal is mapped to GPIO 33. In the slave controller, I run the application "PWM_sync_slave" which sets up the PWM1 module for receiving the synchronization input signal from GPIO32. Unfortunately, the synchronization between the two PWM modules does not work. I displayed the output of GPIO 33 in a scope and found out that no sync pulse was being transmitted. I attach a screenshot displaying the ouput of the scope. The blue line represents the GPIO33 output whereas the red line show the PWM1 ouput of the Master card. Can anyone suggest what I am doing wrong? Thanks
Find below the fragment of code where the configuration is set.
/*********************************************
********** PWM_sync_master ***************
**********************************************/
// PWM setup for Master PWM module
EPwm1Params.TBCTL_SWFSYNC = 0;
EPwm1Params.TBPRD = 4097;
EPwm1Params.TBCTL_CTRMODE = 2;
EPwm1Params.TBCTL_SYNCOSEL = 1; //CTR = zero
EPwm1Params.TBCTL_PHSEN = 0;
EPwm1Params.TBCTL_PHSDIR = 0;
EPwm1Params.TBPHS = 0;
EPwm1Params.TBCTL_HSPCLKDIV = 0;
EPwm1Params.TBCTL_CLKDIV = 0;
// Additional configuration for Master PWM module
void config_ePWM_GPIO (void)
{
EALLOW;
/*-- Configure pin assignments for ePWM1 --*/
GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 1; // Configure GPIO0 as EPWM1A
GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 1; // Configure GPIO1 as EPWM1B
GpioCtrlRegs.GPBMUX1.bit.GPIO33 = 2; // Configure GPIO33 as xSYNCO.
EDIS;
}
==================================================================================================
/*********************************************
********** PWM_sync_slave ***************
*********************************************/
/*-- Setup Time-Base (TB) Submodule --*/
EPwm1Params.TBCTL_SWFSYNC = 0;
EPwm1Params.TBPRD = 4097;
EPwm1Params.TBCTL_CTRMODE = 2;
EPwm1Params.TBCTL_SYNCOSEL = 0; //EPWMxSYNCO=EPWMxSYNCI
EPwm1Params.TBCTL_PHSEN = 0;
EPwm1Params.TBCTL_PHSDIR = 0;
EPwm1Params.TBPHS = 0;
EPwm1Params.TBCTL_HSPCLKDIV = 0;
EPwm1Params.TBCTL_CLKDIV = 0;
void config_ePWM_GPIO (void)
{
EALLOW;
/*-- Configure pin assignments for ePWM1 --*/
GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 1; // Configure GPIO0 as EPWM1A
GpioCtrlRegs.GPAMUX1.bit.GPIO1 = 1; // Configure GPIO1 as EPWM1B
GpioCtrlRegs.GPBMUX1.bit.GPIO32 = 2; // Configure GPIO32 as xSYNCI.
EDIS;
}