10.2.4 CLA Tasks and Interrupt Vectors
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:
•
Peripheral interrupt trigger
Each task can be triggered by software-selectable interrupt sources. The trigger for each task is defined by
writing an appropriate value to the MPISRCSEL1[PERINTnSEL] bit field. Each option specifies an interrupt
source from a specific peripheral on the shared bus. The peripheral interrupt triggers are listed in
For example, Task 1 (MVECT1) can be set to trigger on EPWM1_INT by writing 2 to
MPISRCSEL1[PERINT1SEL]. To disable the triggering of a task by a peripheral, the user must configure
the MPISRCSEL1[PERINTxSEL] bit field to a "No interrupt source" selection.
•
Software Trigger
CPU software can trigger tasks by writing to the MIFRC register or by the IACK instruction. Using the IACK
instruction is more efficient because it does not require you 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 will set bit 0 in the MIFR register to start task 1. Likewise IACK #0x0003
will set bits 0 and 1 in the MIFR register to start task 1 and task 2.
The CLA has its own 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 will remain set until they 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) will start.
The flow is as follows:
1. The associated RUN register bit is set (MIRUN) and the flag bit (MIFR) is cleared.
2. The CLA begins execution at the location indicated by the associated interrupt vector (MVECTx). MVECT
contains the absolute 16-bit address of the task in the lower 64K memory space.
3. The CLA executes instructions until the MSTOP instruction is found. This indicates the end of the task.
4. The MIRUN bit is cleared.
5. The task-specific interrupt to the PIE is issued. This informs the main CPU that the task has completed.
6. The CLA returns to idle.
Once a task completes the next highest-priority pending task is automatically serviced and this sequence
repeats.
Control Law Accelerator (CLA)
574
TMS320x2806x Microcontrollers
SPRUH18I – JANUARY 2011 – REVISED JUNE 2022
Copyright © 2022 Texas Instruments Incorporated
Summary of Contents for TMS320 2806 Series
Page 2: ......