EasyManuals Logo

Texas Instruments C2000 Workshop Guide And Lab Manual

Texas Instruments C2000
342 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 #248 background imageLoading...
Page #248 background image
Control Law Accelerator (CLA)
10 - 12 C2000 Microcontroller Workshop - Control Law Accelerator
CLA Compiler Scratchpad Memory Area
For local and compiler temporary variables
Static allocation, used instead of a stack
Defined in linker command file
CLA_SCRATCHPAD_SIZE = 0x100;
--undef_sym=__cla_scratchpad_end
--undef_sym=__cla_scratchpad_start
MEMORY
{
}
SECTIONS
{
Cla1Prog :> L3DPSARAM, PAGE = 0
RUN_START(_Cla1Prog_Start)
CLAscratch :{*.obj(CLAscratch
. += CLA_SCRATCHPAD_SIZE;
*.obj(CLAscratch_end)
} > L2DPSARAM, PAGE = 1
}
Lab.cmd
Linker defined symbol
specifies size for
scratchpad area
Scratchpad area
accessed directly
using symbols
All CLA C code will be
placed in the section
Cla1Prog
Symbol used to define
the start of CLA
program memory
Must allocate to
memory section that
CLA has write access
CLA Task C Code Example
#include "Lab.h"
;-------------------------------------
interrupt void Cla1Task1 (void)
{
__mdebugstop();
xDelay[0] = (float32)AdcResult.ADCRESULT0;
Y = coeffs[4] * xDelay[4];
xDelay[4] = xDelay[3];
xDelay[1] = xDelay[0];
Y = Y + coeffs[0] * xDelay[0];
ClaFilteredOutput = (Uint16)Y;
}
;-------------------------------------
interrupt void Cla1Task2 (void)
{
}
;-------------------------------------
ClaTasks_C.cla
.cla extension causes
the c2000 compiler to
invoke the CLA
compiler
All code within this
file is placed in the
section “Cla1Prog”
C Peripheral Register
Header File references
can be used in CLA C
and assembly code
Closing braces are
replaced with MSTOP
instructions when
compiled

Table of Contents

Other manuals for Texas Instruments C2000

Questions and Answers:

Question and Answer IconNeed help?

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

Texas Instruments C2000 Specifications

General IconGeneral
BrandTexas Instruments
ModelC2000
CategoryMicrocontrollers
LanguageEnglish

Related product manuals