EasyManuals Logo

Texas Instruments TMS320F2837 D Series Workshop Guide And Lab Manual

Texas Instruments TMS320F2837 D Series
324 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #241 background imageLoading...
Page #241 background image
Control Law Accelerator (CLA)
TMS320F2837xD Microcontroller Workshop - Control Law Accelerator 9 - 17
CLA Initialization Code Example
#include "F2837xD_Cla_typedefs.h"
#include F2837xD_Device.h"
extern interrupt void Cla1Task1();
extern interrupt void Cla1Task2();
extern interrupt void Cla1Task8();
Lab.h
#include "Lab.h"
// Initialize CLA task interrupt vectors
Cla1Regs.MVECT1 = (uint16_t)(&Cla1Task1);
Cla1Regs.MVECT2 = (uint16_t)(&Cla1Task2);
Cla1Regs.MVECT7 = (uint16_t)(&Cla1Task7);
Cla1Regs.MVECT8 = (uint16_t)(&Cla1Task8);
Cla.c
Defines data types and
special registers
specific to the CLA
Defines register bit
field structures
CLA task prototypes
are prefixed with the
‘interrupt’ keyword
CLA task symbols are
visible to all C28x CPU
and CLA code
Type-1 CLAs MVECT registers accept full 16-bit task addresses as opposed to offsets used on older Type-0 CLAs
CLA Code Debugging
CLA Code Debugging
1.
Insert a breakpoint in the CLA code
Insert a MDEBUGSTOP instruction(s) in the code where desired then rebuild/reload
In C code, can use __mdebugstop() intrinsic, or asm(“ MDEBUGSTOP”)
When the debugger is not connected, the MDEBUGSTOP acts like an MNOP
2.
Connect to the CLA target in CCS
This enables CLA breakpoints
3.
Run the CPU target
CLA task will trigger (via peripheral interrupt or software)
CLA executes instructions until MDEBUGSTOP is hit
4.
Load the code symbols into the CLA context in CCS
This allows source-level debug
Needs to be done only once per debug session unless the .out file changes
5.
Debug the CLA code
Can single-step the code, or run to the next MDEBUGSTOP or to the end of the task
If another task is pending, it will start at the end of the previous task
6.
Disconnect the CLA target to disable CLA breakpoints, if desired
The CLA and CPU are debugged from the same JTAG port
You can halt, single-step, and run the CLA independent of the CPU
A CLA single step execute one pipeline cycle, whereas a CPU single
step executes one instruction (and flushes the pipeline)

Table of Contents

Other manuals for Texas Instruments TMS320F2837 D Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320F2837 D Series and is the answer not in the manual?

Texas Instruments TMS320F2837 D Series Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320F2837 D Series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals