SPRUJ79 November 2024 F29H850TU , F29H859TU-Q1
For variable frequency applications, there is a need for simultaneous writes of TBPRD and CMPx registers between ePWM modules. This prevents situations where a CTR = 0 or CTR = PRD pulse forces a shadow to active load of these registers before all registers are updated between ePWM modules (resulting in some registers being loaded from new shadow values while others are loaded from old shadow values). To support this, an ePWM instance linking scheme for all registers in an ePWM instance has been added. There is now a dedicated XLINK region in the memory map to support writes to any of the ePWM registers to reflect in other ePWM instances. All ePWM individual module instances are mirrored to the XLINK region by configuring the SYSCTL'S EPWMXLINKCFG bit. If multiple ePWM instances have this feature enabled, then any writes in the XLINK region of an ePWM instance reflects to all other ePWM instances that have the ePWM instances enabled. If the write occurs in the individual register memory space, then the update only reflects on that individual ePWM. Any reads to mirrored regions return 0.
Example:
Linking PWMs 1,2,3 using Driverlib will result in
SysCtl_enableEPWMXLINK(EPWM1BASE | EPWM2BASE | EPWM3BASE);
Write to the XLINK region of PWM 1 to write to EPWM 1,2,3 using the XLINK_BASE address results in
EPWM_setCounterCompareValue(EPWM1XLINK_BASE, EPWM_COUNTER_COMPARE_A, CMPAVAL);
Any writes to the EPWMnXLINK_BASE memory region will write to all other PWMs. If you only want to update an independent PWM's register value then do not use the XLINK base memory mapped regions. Below is an example to write to EPWM1's CMPA value independently of other linked PWM 2,3.
EPWM_setCounterCompareValue(EPWM1_BASE, EPWM_COUNTER_COMPARE_A, CMPAVAL);