SPRUIM2H May 2020 – October 2023 AM2431 , AM2432 , AM2434 , AM6411 , AM6412 , AM6421 , AM6422 , AM6441 , AM6442
It is possible for the EPWM action qualifier to receive more than one event at the same time. In this case events are assigned a priority by the hardware. The general rule is: events occurring later in time have a higher priority and software forced events always have the highest priority. The event priority levels for up-down-count mode are shown in Table 12-4321. A priority level 1 is the highest priority and level 7 is the lowest. The priority changes slightly depending on the direction of TBCNT.
Priority Level | Event if TBCNT is Incrementing TBCNT = 0 up to TBCNT = TBPRD | Event if TBCNT is Decrementing TBCNT = TBPRD down to TBCNT = 1 |
---|---|---|
1 (Highest) | Software forced event | Software forced event |
2 | Counter equals CMPB on up-count (CBU) | Counter equals CMPB on down-count (CBD) |
3 | Counter equals CMPA on up-count (CAU) | Counter equals CMPA on down-count (CAD) |
4 | Counter equals zero | Counter equals period (TBPRD in EPWM_TBPRD active register) |
5 | Counter equals CMPB on down-count (CBD) (1) | Counter equals CMPB on up-count (CBU) (1) |
6 (Lowest) | Counter equals CMPA on down-count (CAD) (1) | Counter equals CMPA on up-count (CBU) (1) |
Table 12-4322 shows the action-qualifier priority for up-count mode. In this case, the counter direction is always defined as up and thus down-count events will never be taken.
Priority Level | Event |
---|---|
1 (Highest) | Software forced event |
2 | Counter equal to period (TBPRD) |
3 | Counter equal to CMPB on up-count (CBU) |
4 | Counter equal to CMPA on up-count (CAU) |
5 (Lowest) | Counter equal to Zero |
Table 12-4323 shows the action-qualifier priority for down-count mode. In this case, the counter direction is always defined as down and thus up-count events will never be taken.
Priority Level | Event |
---|---|
1 (Highest) | Software forced event |
2 | Counter equal to Zero |
3 | Counter equal to CMPB on down-count (CBD) |
4 | Counter equal to CMPA on down-count (CAD) |
5 (Lowest) | Counter equal to period (TBPRD) |
It is possible to set the compare value greater than the period. In this case the action will take place as shown in Table 12-4324.
Counter Mode | Compare on Up-Count Event CAU/CBU | Compare on Down-Count Event CAU/CBU |
---|---|---|
Up-Count Mode | If CMPA/CMPB ≤ TBPRD period, then the event occurs on a compare match (TBCNT = CMPA or CMPB). | Never occurs. |
If CMPA/CMPB > TBPRD, then the event will not occur. | ||
Down-Count Mode | Never occurs. | If CMPA/CMPB < TBPRD, the event will occur on a compare match (TBCNT = CMPA or CMPB). |
If CMPA/CMPB ≥ TBPRD, the event will occur on a period match (TBCNT = TBPRD). | ||
Up-Down-Count Mode | If CMPA/CMPB < TBPRD and the counter is incrementing, the event occurs on a compare match (TBCNT = CMPA or CMPB). | If CMPA/CMPB < TBPRD and the counter is decrementing, the event occurs on a compare match (TBCNT = CMPA or CMPB). |
If CMPA/CMPB is ≥ TBPRD, the event will occur on a period match (TBCNT = TBPRD). | If CMPA/CMPB ≥ TBPRD, the event occurs on a period match (TBCNT = TBPRD). |