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.

LAUNCHXL-F28379D: Force EPWM to LOW when turning off by resetting PCLKCR2.bit.EPWM1 | EPWM2

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

Hi,

I use 3 launchpads to create a 1 Master - 2 Slaves configuration.

I am using clock signals from Master to synchronize SPWM generation on the slaves. I reset PCLKCR2.bit.EPWM1 | EPWM2 to turn OFF the outputs and set the same bits to turn ON the outputs.

The problem I am facing is that even when I load identical code on both the slave launchpads, when I turn OFF; randomly one of the boards is HIGH and the other is LOW or vice versa. Or sometimes both are LOW or both are HIGH. I would like to ensure that both the boards are LOW when I turn OFF the outputs by resetting PCLKCR2 register bits.

My EPWM1 initialization function on slave is as below. Could you please suggest the changes needed in the below initialization to achieve LOW output when output is turned off?

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void epwm1init(void)
{
/* Disable TBCLK within the EPWM*/
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
/* Time Base Control Register */
EPWM_setTimeBaseCounterMode(EPWM1_BASE, EPWM_COUNTER_MODE_UP_DOWN);
EPWM_setSyncOutPulseMode(EPWM1_BASE, EPWM_SYNC_OUT_PULSE_ON_COUNTER_ZERO);
EPWM_setPeriodLoadMode(EPWM1_BASE, EPWM_PERIOD_SHADOW_LOAD);
EPWM_selectPeriodLoadEvent(EPWM1_BASE, EPWM_SHADOW_LOAD_MODE_COUNTER_ZERO);
EPWM_enablePhaseShiftLoad(EPWM1_BASE);
EPWM_setCountModeAfterSync(EPWM1_BASE, EPWM_COUNT_MODE_DOWN_AFTER_SYNC);
EPWM_setClockPrescaler(EPWM1_BASE, EPWM_CLOCK_DIVIDER_1,
EPWM_HSCLOCK_DIVIDER_1);
/* Setup Time-Base (TB) Submodule --*/
EPWM_setTimeBasePeriod(EPWM1_BASE, EPWM1_PRD);
/* Time-Base Phase Register */
EPWM_setPhaseShift(EPWM1_BASE, 0);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I have tried

1. Clearing TBCTR before turning OFF clock, does not work.

2. I also tried using Action Qualifier SW Force registers just before turning OFF clock, does not work.

Regards,

Rashmitha