SPRUJ79 November 2024 F29H850TU
The XCMP complex waveform generation mode is described in this section.
The XCMP mode can be used to generate multiple edges within one ePWM period. The application software must write the location of the ePWM waveform edges to the XCMP registers. Each XCMPn register assigned and used for an ePWM CMPx (CMPA or CMPB) must be spaced out according to the following guidelines to make sure of correct waveform generation.
Figure 30-39 shows an example of four XCMP values being loaded into CMPA during one period cycle and the remaining four XCMP values being used for CMPB. When the action for the last XCMP value loaded into CMPA/CMPB in a period is met, the last value for CMPA/CMPB remains until the next time TBCTR = 0 due to a new shadow set load.
Assume XCMP1-3 are assigned and used by CMPA (XCMP4 is not used), and XCMP5-6 are assigned and used by CMPB (XCMP7 and XCMP8 are not used):
For XCMP1-3 in this scenario, since all are used by CMPA, the values written to XCMP1, XCMP2, and XCMP3 must:
The requirements above for the minimum difference between XCMP(n+1) and XCMPn must be met in the application software.
The actions taken for each XCMP1-8 must be configured in XAQCTLA and XAQCTLB.
If shadowing is required then the XCMP1-8, XAQCTLA and XAQCTLB values must be written to the corresponding shadow buffer. As an example, Table 30-9 shows how the shadow buffers are used in LOADMULTIPLE mode.
The SHDW buffers 2 and 3 can also be repeated more than once by using the RPTBUF2PRD and RPTBUF3PRD.
XCMPn, XTBPRD | XTBPRD, TBPRD | XCMPn: XCMPnHR |
CMPA: CMPAHR |
What happens next? | |||
---|---|---|---|---|---|---|---|
SHDW3FULL | SHDW2FULL | SHDW1FULL | Active | Active | Active | ||
CPU Initialization | Set | Set | Set | Registers initialized by CPU. Load event occurs. | |||
ePWM Cycle 1 | Clear | Set | Set | XTBPRD_ SHDW3 |
XCMPn_ SHDW3 |
XCMPn_ SHDW3 |
SHDWBUFPTR set to 3 |
ePWM Cycle 2 | Clear | Clear | Set | XTBPRD_ SHDW2 |
XCMPn_ SHDW2 |
XCMPn_ SHDW2 |
SHDWBUFPTR set to 2 |
ePWM Cycle 3 | Clear | Clear | Clear | XTBPRD_ SHDW1 |
XCMPn_ SHDW1 |
XCMPn_ SHDW1 |
SHDWBUFPTR set to 1 |
ePWM Cycle 4 | Clear | Clear | Clear | XTBPRD_ SHDW1 |
XCMPn_ SHDW1 |
XCMPn_ SHDW1 |
SHDWBUFPTR set to 1 No shadow to active loading from buffer. Operation continues with values in XCMPn_ACTIVE registers. |
ePWM Cycle 5 | Clear | Clear | Clear | XTBPRD_ SHDW1 |
XCMPn_ SHDW1 |
XCMPn_ SHDW1 |
SHDWBUFPTR set to 1 Continues operation with same values in XCMPn_ACTIVE until the next buffer load event |
CPU Load (During ePWM Cycle 5) | Set | Set | Set | XTBPRD_ SHDW1 |
XCMPn_ SHDW1 |
XCMPn_ SHDW1 |
CPU loads new shadow value set. Load event occurs. SHDWBUFPTR set to 3 |
ePWM Cycle 6 | Clear | Set | Set | XTBPRD_ SHDW3 |
XCMPn_ SHDW3 |
XCMPn_ SHDW3 |
SHDWBUFPTR set to 3 |
ePWM Cycle 7 | Clear | Clear | Set | XTBPRD_ SHDW2 |
XCMPn_ SHDW2 |
XCMPn_ SHDW2 |
SHDWBUFPTR set to 2 |
ePWM Cycle 8 | Clear | Clear | Clear | XTBPRD_ SHDW1 |
XCMPn_ SHDW1 |
XCMPn_ SHDW1 |
SHDWBUFPTR set to 1 |
ePWM Cycle 9 | Clear | Clear | Clear | XTBPRD_ SHDW1 |
XCMPn_ SHDW1 |
XCMPn_ SHDW1 |
Continues operation with the same values in XCMPn_ACTIVE until the next buffer load event. SHDWBUFPTR set to 1 |
ePWM Cycle 10 | Set | Set | Set | XTBPRD_ SHDW1 |
XCMPn_ SHDW1 |
XCMPn_ SHDW1 |
CPU loads new shadow register set. Load event occurs. SHDWBUFPTR set to 3 |