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 #251 background imageLoading...
Page #251 background image
Control Law Accelerator (CLA)
C2000 Microcontroller Workshop - Control Law Accelerator 10 - 15
CLA Task Assembly Code Example
.cdecls "Lab.h"
.sect "Cla1Prog"
_Cla1Prog_Start:
_Cla1Task1: ; FIR filter
MUI16TOF32 MR2, @_AdcResult.ADCRESULT0
MMPYF32 MR2, MR1, MR0
MADDF32 MR3, MR3, MR2
MF32TOUI16 MR2, MR3
MMOV16 @_ClaFilteredOutput, MR2
MSTOP ; End of task
;-------------------------------------
_Cla1Task2:
MSTOP
;-------------------------------------
_Cla1Task3:
MSTOP
ClaTasks.asm
.cdecls directive used
to include the C
header file in the CLA
assembly file
.sect directive used to
place CLA assembly
code in its own
section
C Peripheral Register
Header File references
can be used in CLA
assembly code
MSTOP instruction
used at the end of the
task
CLA Initialization Code Example
#include "F2806x_Cla_typedefs.h"
#include F2806x_Device.h"
extern Uint16 Cla1Prog_Start;
extern interrupt void Cla1Task1();
extern interrupt void Cla1Task2();
extern interrupt void Cla1Task8();
Lab.h
#include "Lab.h"
// Symbols used to calculate vector address
Cla1Regs.MVECT1 =
(Uint16)((Uint32)&Cla1Task1 -
(Uint32)&Cla1Prog_Start);
Cla1Regs.MVECT2 =
(Uint16)((Uint32)&Cla1Task2 -
(Uint32)&Cla1Prog_Start);
Cla.c
Defines data types and
special registers
specific to the CLA
Defines register bit
field structures
Symbol for start of CLA
program RAM defined
in Lab.cmd
CLA task prototypes
are prefixed with the
‘interrupt’ keyword
CLA task symbols are
visible to all C28x CPU
and CLA code
MVECTx contains the offset address from the start of the CLA Program RAM

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