AM263P4: AM263Px EPWM Dead-Band: DBCTL2[SHDWDBCTLMODE] cannot be enabled via SysConfig/Driver API?

Part Number: AM263P4
Other Parts Discussed in Thread: TMDSCNCD263P, SYSCONFIG

Hi,

I have a question regarding EPWM Dead-Band shadow mode behavior on AM263Px.

■ Environment
EVM: TMDSCNCD263P
SDK: mcu_plus_sdk_am263px_11_01_00_19
SysConfig: 1.26.0

I evaluated the following SysConfig options under EPWM Dead-Band:

1) Enable Deadband Control Shadow Mode (OFF/ON)
2) Enable RED Shadow Mode (OFF/ON)
3) Enable FED Shadow Mode (OFF/ON)

When these options are set to ON, the corresponding EPWM_disable***() functions are removed from the generated code.

The relevant generated code is as follows:

/* Deadband */
EPWM_disableDeadBandControlShadowLoadMode(CONFIG_EPWM1_BASE_ADDR);  // removed if (1) is ON
EPWM_setDeadBandControlShadowLoadMode(CONFIG_EPWM1_BASE_ADDR, EPWM_DB_LOAD_ON_CNTR_ZERO);

EPWM_disableRisingEdgeDelayCountShadowLoadMode(CONFIG_EPWM1_BASE_ADDR); // removed if (2) is ON
EPWM_setRisingEdgeDelayCountShadowLoadMode(CONFIG_EPWM1_BASE_ADDR, EPWM_RED_LOAD_ON_CNTR_ZERO);

EPWM_disableFallingEdgeDelayCountShadowLoadMode(CONFIG_EPWM1_BASE_ADDR); // removed if (3) is ON
EPWM_setFallingEdgeDelayCountShadowLoadMode(CONFIG_EPWM1_BASE_ADDR, EPWM_FED_LOAD_ON_CNTR_ZERO);

■ Observed register values (checked in WATCH window during debug execution)

Regardless of the SysConfig ON/OFF settings, I observed:

DBCTL2[SHDWDBCTLMODE] = 0
DBCTL[SHDWDBREDMODE]  = 1
DBCTL[SHDWDBFEDMODE]  = 1

■ Code-level analysis

EPWM_setDeadBandControlShadowLoadMode() sets only DBCTL2[LOADDBCTLMODE]
and does not set DBCTL2[SHDWDBCTLMODE].

However, the RED/FED shadow load APIs explicitly set
DBCTL[SHDWDBREDMODE] and DBCTL[SHDWDBFEDMODE] to 1.

As a result, it appears that:

- DBCTL2[SHDWDBCTLMODE] cannot be enabled via SysConfig + driver API.
- DBCTL[SHDWDBREDMODE] and DBCTL[SHDWDBFEDMODE] are always enabled
  when the corresponding set APIs are called.

■ Questions

1) Is this behavior intentional (by design), or is it an implementation issue
   in SysConfig or the driver library?

2) If shadow mode control for DBCTL2 is required,
   is it expected that users manually set DBCTL2[SHDWDBCTLMODE] in their code?

3) Is there a design reason why RED/FED shadow mode is explicitly enabled
   in the API, while DBCTL2 shadow mode is not?

Thank you for your clarification.

Tetsuo Amano

  • Hi Tetsuo,

    EPWM_setDeadBandControlShadowLoadMode() only programs the load-event selection (DBCTL2[LOADDBCTLMODE]) and does not assert DBCTL2[SHDWDBCTLMODE]. So SHDWDBCTLMODE stays at its reset/default value (you observed 0).

    EPWM_setRisingEdgeDelayCountShadowLoadMode() and EPWM_setFallingEdgeDelayCountShadowLoadMode() explicitly set DBCTL[SHDWDBREDMODE]=1 and DBCTL[SHDWDBFEDMODE]=1 as part of configuring the load mode (the API text also implies enabling shadowing). So once those “set” APIs run, your WATCH window will show 1 for both, regardless of whether SysConfig previously emitted a disable...() call.

    The actual implementation only setting the load event is an implementation gap / missing bit-set in the driverlib + SysConfig codegen path for DBCTL2[SHDWDBCTLMODE], not an intentional “by design” behavior. I’ll file a report for this.

    Yes, with the current behavior, if you require DBCTL shadowing (DBCTL2 path) you should manually set DBCTL2[SHDWDBCTLMODE]=1 in your application before selecting the load event.

    Best Regards,

    Masoud

  • Hi Masoud,

    Thank you for the clarification and for filing the report.

    Your explanation matches my observations.
    For now, I will manually set DBCTL2[SHDWDBCTLMODE] = 1 in my application before selecting the load event.

    Thanks again for your support.

    Best regards,
    Tetsuo