SPRUHX5I August 2014 – May 2024 TMS320F28374S , TMS320F28375S , TMS320F28375S-Q1 , TMS320F28376S , TMS320F28377S , TMS320F28377S-Q1 , TMS320F28378S , TMS320F28379S
The CLA program code is divided up into tasks or interrupt service routines. Tasks do not have a fixed starting location or length. The CLA program memory can be divided up as desired. The CLA uses the contents of the interrupt vectors (MVECT1 to MVECT8) to determine where a task begins; tasks are terminated by the MSTOP instruction.
The CLA supports eight tasks. Task 1 has the highest priority and task 8 has the lowest priority.
A task can be requested by a peripheral interrupt or by software:
Each task can be triggered by software-selectable interrupt sources. The trigger for each task is defined by writing an appropriate value to the DmaClaSrcSelRegs.CLA1TASKSRCSELx[TASKx] bit field. Each option specifies an interrupt source from a specific peripheral on the shared bus. The peripheral interrupt triggers are listed in Table 6-1.
For example, task 1 (MVECT1) can be set to trigger on EPWMINT1 by writing 36 to DmaClaSrcSelRegs.CLA1TASKSRCSEL1.TASK1. To disable the triggering of a task by a peripheral, set the DmaClaSrcSelRegs.CLA1TASKSRCSELx[TASKx] bit field to 0. Note that a CLA task only triggers on a level transition (an edge) of the configured interrupt source.
Select Value | CLA Trigger Source |
---|---|
0 | CLA_SOFTWARE_TRIGGER |
1 | ADCAINT1 |
2 | ADCAINT2 |
3 | ADCAINT3 |
4 | ADCAINT4 |
5 | ADCA_EVT_INT |
6 | ADCBINT1 |
7 | ADCBINT2 |
8 | ADCBINT3 |
9 | ADCBINT4 |
10 | ADCB_EVT_INT |
11 | ADCCINT1 |
12 | ADCCINT2 |
13 | ADCCINT3 |
14 | ADCCINT4 |
15 | ADCC_EVT_INT |
16 | ADCDINT1 |
17 | ADCDINT2 |
18 | ADCDINT3 |
19 | ADCDINT4 |
20 | ADCD_EVT_INT |
21-28 | Reserved |
29 | XINT1 |
30 | XINT2 |
31 | XINT3 |
32 | XINT4 |
33 | XINT5 |
34-35 | Reserved |
36 | EPWM1_INT |
37 | EPWM2_INT |
38 | EPWM3_INT |
39 | EPWM4_INT |
40 | EPWM5_INT |
41 | EPWM6_INT |
42 | EPWM7_INT |
43 | EPWM8_INT |
44 | EPWM9_INT |
45 | EPWM10_INT |
46 | EPWM11_INT |
47 | EPWM12_INT |
48-67 | Reserved |
68 | CPU_TINT0 |
69 | CPU_TINT1 |
70 | CPU_TINT2 |
71 | MCBSPA_TX |
72 | MCBSPA_RX |
73 | MCBSPB_TX |
74 | MCBSPB_RX |
75 | ECAP1_INT |
76 | ECAP2_INT |
77 | ECAP3_INT |
78 | ECAP4_INT |
79 | ECAP5_INT |
80 | ECAP6_INT |
81-82 | Reserved |
83 | EQEP1_INT |
84 | EQEP2_INT |
85 | EQEP3_INT |
86-94 | Reserved |
95 | SD1_ERRINT |
96 | SD2_ERRINT |
97-106 | Reserved |
107 | UPPA_INT |
108 | Reserved |
109 | SPIA_TXINT |
110 | SPIA_RXINT |
111 | SPIB_TXINT |
112 | SPIB_RXINT |
113 | SPIC_TXINT |
114 | SPIC_RXINT |
115-126 | Reserved |
127 | CLB1_INT |
128 | CLB2_INT |
129 | CLB3_INT |
130 | CLB4_INT |
131-255 | Reserved |
CPU software can trigger tasks by writing to the MIFRC register or by the IACK instruction. Using the IACK instruction is more efficient because the instruction does not require the need to issue an EALLOW to set MIFR bits. Set the MCTL[IACKE] bit to enable the IACK feature. Each bit in the operand of the IACK instruction corresponds to a task. For example, IACK #0x0001 sets bit 0 in the MIFR register to start task 1. Likewise, IACK #0x0003 set bits 0 and 1 in the MIFR register to start task 1 and task 2.
The CLA has a fetch mechanism and can run and execute a task independent of the CPU. Only one task is serviced at a time; there is no nesting of tasks. The task currently running is indicated in the MIRUN register. Interrupts that have been received but not yet serviced are indicated in the flag register (MIFR). If an interrupt request from a peripheral is received and that same task is already flagged, then the overflow flag bit is set. Overflow flags remain set until the flags are cleared by the CPU.
If the CLA is idle (no task is currently running), then the highest priority interrupt request that is both flagged (MIFR) and enabled (MIER) starts.
The flow is as follows:
Once a task completes the next highest-priority pending task is automatically serviced and this sequence repeats.