SYSCONFIG: SysConfig skips EPWM_setADCTriggerSource() when SOCA source is left at the UI default

Part Number: SYSCONFIG

Hi Experts,

Can you help with the inquiry below?

I have two timebase-only EPWMs. adcEPWM1 triggers the ADC off
TBCTR_PERIOD. dacEPWM2 triggers DMA CH1 off TBCTR_ZERO to feed
DACVALS.

The DAC output was stuck. Turned out board.c has this:

  EPWM_enableADCTrigger(adcEPWM1_BASE, EPWM_SOC_A);
  EPWM_setADCTriggerSource(adcEPWM1_BASE, EPWM_SOC_A, EPWM_SOC_TBCTR_PERIOD);
  EPWM_setADCTriggerEventPrescale(adcEPWM1_BASE, EPWM_SOC_A, 1);
  ...
  EPWM_enableADCTrigger(dacEPWM2_BASE, EPWM_SOC_A);
  EPWM_setADCTriggerEventPrescale(dacEPWM2_BASE, EPWM_SOC_A, 1);

No setADCTriggerSource() for dacEPWM2. The only difference between the two
is the source value I picked.

I assume it's being skipped because TBCTR_ZERO is SysConfig's UI default.
Problem is that isn't the reset value: ETSEL.SOCASEL resets to 0 =
DCAEVT1, and TBCTR_ZERO is 1. So SOCA ends up enabled but wired to a
digital-compare event that's never configured.

Registers at runtime:

  EPwm2Regs.TBPRD           xxx       ok
  EPwm2Regs.TBCTR           counting  ok
  EPwm2Regs.ETSEL.SOCAEN    1         ok
  EPwm2Regs.ETSEL.SOCASEL   0         should be 1
  EPwm2Regs.ETFLG.SOCA      0         never fires
  DmaRegs.CH1.CONTROL.RUNSTS   1
  DmaRegs.CH1.TRANSFER_SIZE    xxx
  DmaRegs.CH1.TRANSFER_COUNT   0      never triggered

What made this hard to find is that everything looks fine. The EPWM is
counting, the DMA reports itself running, the DAC registers are all
correct. It took a full register dump to spot SOCASEL.

Workaround, calling it myself after Board_init():

  EPWM_setADCTriggerSource(dacEPWM2_BASE, EPWM_SOC_A, EPWM_SOC_TBCTR_ZERO);

Picking a non-default source also works, since then the call gets emitted.

Could the generator either always emit this call when the trigger is
enabled, or compare against the register reset value instead of the UI
default? And it might be worth checking whether other fields have the same
mismatch — anywhere a UI default differs from a reset value, this could
happen again.

Thanks!

Marvin