Part Number: TMS320F280039C
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE
If I configure an ePWM Counter Compare submodule for immediate mode (shadow mode disabled), e.g. by unchecking the "Enable Shadow Counter Compare A (CMPA)" checkbox, the code line "EPWM_disableCounterCompareShadowLoadMode(myEPWM_base, EPWM_COUNTER_COMPARE_A);" is correctly inserted into the source file "board.c". This function sets the SHDWAMODE Bit in register COMPCTL. However, after this line, the following wrong and unnecessary code is inserted:
"EPWM_setCounterCompareShadowLoadMode(myEPWM_base, EPWM_COUNTER_COMPARE_A, EPWM_COMP_LOAD_ON_CNTR_ZERO);"
The Shadow Load Event is irrelevant in immediate mode, but the function "EPWM_setCounterCompareShadowLoadMode" not only sets the irrelevant Shadow Load Event, but it also reenables the shadow mode by clearing the SHDWAMODE Bit again. So we always end up in Shadow mode enabled, even if immediate mode was activated in the syscfg tool.
This bug was found in CCS version 20.5.0.28__1.11.0, SysConfig tool 1.27.0.4565, and C2000Ware 26_00_00_00.