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