SPRUHX5I August 2014 – May 2024 TMS320F28374S , TMS320F28375S , TMS320F28375S-Q1 , TMS320F28376S , TMS320F28377S , TMS320F28377S-Q1 , TMS320F28378S , TMS320F28379S
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 14-4. A priority level of 1 is the highest priority and level 10 is the lowest. The priority changes slightly depending on the direction of TBCTR.
Priority Level | Event If TBCTR
is Incrementing TBCTR = Zero up to TBCTR = TBPRD |
Event If TBCTR is
Decrementing TBCTR = TBPRD down to TBCTR = 1 |
---|---|---|
1 (Highest) | Software forced event | Software forced event |
2 | T1 on up-count (T1U) | T1 on down-count (T1D) |
3 | T2 on up-count (T2U) | T2 on down-count (T2D) |
4 | Counter equals CMPB on up-count (CBU) | Counter equals CMPB on down-count (CBD) |
5 | Counter equals CMPA on up-count (CAU) | Counter equals CMPA on down-count (CAD) |
6 (Lowest) | Counter equals zero | Counter equals period (TBPRD) |
Table 14-5 shows the action-qualifier priority for up-count mode. In this case, the counter direction is always defined as up; therefore, down-count events never are taken.
Priority Level | Event |
---|---|
1 (Highest) | Software forced event |
2 | Counter equal to period (TBPRD) |
3 | T1 on up-count (T1U) |
4 | T2 on up-count (T2U) |
5 | Counter equal to CMPB on up-count (CBU) |
6 | Counter equal to CMPA on up-count (CAU) |
7 (Lowest) | Counter equal to Zero |
Table 14-6 shows the action-qualifier priority for down-count mode. In this case, the counter direction is always defined as down; therefore, up-count events never are taken.
Priority Level | Event |
---|---|
1 (Highest) | Software forced event |
2 | Counter equal to Zero |
3 | T1 on down-count (T1D) |
4 | T2 on down-count (T2D) |
5 | Counter equal to CMPB on down-count (CBD) |
6 | Counter equal to CMPA on down-count (CAD) |
7 (Lowest) | Counter equal to period (TBPRD) |
It is possible to set the compare value greater than the period. In this case, the action takes place as shown in Table 14-7.
Counter Mode | Compare on Up-Count
Event CAD/CBD |
Compare on
Down-Count Event CAD/CBD |
---|---|---|
Up-Count Mode | If CMPA/CMPB ≤ TBPRD period, then the event occurs on a compare match (TBCTR=CMPA or CMPB). | Never occurs. |
If CMPA/CMPB > TBPRD, then the event does not occur. | ||
Down-Count Mode | Never occurs. | If CMPA/CMPB < TBPRD, the event occurs on a compare match (TBCTR=CMPA or CMPB). |
If CMPA/CMPB ≥ TBPRD, the event occurs on a period match (TBCTR=TBPRD). | ||
Up-Down Count Mode | If CMPA/CMPB < TBPRD and the counter is incrementing, the event occurs on a compare match (TBCTR=CMPA or CMPB). | If CMPA/CMPB < TBPRD and the counter is decrementing, the event occurs on a compare match (TBCTR=CMPA or CMPB). |
If CMPA/CMPB is ≥ TBPRD, the event occurs on a period match (TBCTR = TBPRD). | If CMPA/CMPB ≥ TBPRD, the event occurs on a period match (TBCTR=TBPRD). |