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