4.
Initialize the PIE vector table and registers
When a CLA task completes, the associated interrupt in the PIE will be flagged. The CLA overflow and
underflow flags also have associated interrupts within the PIE.
5.
Enable CLA tasks/interrupts
Set appropriate bits in the interrupt enable register (MIER) to allow the CLA to service interrupts. It should
be noted that a CLA task only triggers on a level transition (a falling edge) of the configured interrupt source.
If a peripheral is enabled and an interrupt fires before the CLA is configured, then the CLA will not see the
interrupt edge and will not respond. To avoid this, configure the CLA before the peripherals or clear any
pending peripheral interrupts before setting bits in the MIER register.
6.
Initialize other peripherals
Initialize any peripherals (such as ePWM, ADC, and others) that will generate interrupt triggers for enabled
CLA tasks.
The CLA is now ready to service interrupts and the message RAMs can be used to pass data between the
CPU and the CLA. Mapping of the CLA program and data RAMs typically occurs only during the initialization
process. If the RAM mapping needs to be changed after initialization, the CLA interrupts must be disabled
and all tasks must be completed (by checking the MIRUN register) prior to modifying the RAM ownership.
10.4.3 Debugging CLA Code
Debugging the CLA code is a simple process that occurs independently of the main CPU. .
10.4.3.1 Breakpoint Support (MDEBUGSTOP)
1.
Insert a breakpoint in CLA code
Insert a CLA breakpoint (MDEBUGSTOP instruction) into the code where you want the CLA to halt,
then rebuild and reload the code. Because the CLA does not flush its pipeline when you single-step, the
MDEBUGSTOP instruction must be inserted as part of the code. The debugger cannot insert it as needed.
If CLA breakpoints are not enabled, then the MDEBUGSTOP will be ignored and is treated as a MNOP.
The MDEBUGSTOP instruction can be placed anywhere in the CLA code as long as it is not within three
instructions of a MBCNDD, MCCNDD, or MRCNDD instruction. When programming in C, the user can
use the __mdebugstop() intrinsic instead; the compiler will ensure that the placement of the MDEBUSTOP
instruction in the generated assembly does not violate any of the pipeline restrictions.
2.
Enable CLA breakpoints
Enable the CLA breakpoints in the debugger. In the Code Composer Studio™ IDE, this is done by
connecting to the CLA core (or tap) from the debug perspective. Breakpoints are disabled when the core is
disconnected.
3.
Start the task
There are three ways to start the task:
a. The peripheral can assert an interrupt,
b. The main CPU can execute an IACK instruction, or
c. The user can manually write to the MIFRC register in the debugger window
When the task starts, the CLA will execute instructions until the MDEBUGSTOP is in the D2 phase of the
pipeline. At this point, the CLA will halt and the pipeline will be frozen. The MPC register will reflect the
address of the MDEBUGSTOP instruction.
Control Law Accelerator (CLA)
580
TMS320x2806x Microcontrollers
SPRUH18I – JANUARY 2011 – REVISED JUNE 2022
Copyright © 2022 Texas Instruments Incorporated
Содержание TMS320 2806 Series
Страница 2: ......