EasyManua.ls Logo

Texas Instruments TMS320F2837 D Series

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
Loading...
Control Law Accelerator (CLA)
9 - 16 TMS320F2837xD Microcontroller Workshop - Control Law Accelerator
CLA Assembly Addressing Modes
Two addressing modes: Direct and Indirect
Both modes can access the lower 64Kx16 of memory only:
All of the CLA data space
Both message RAMs
Shared peripheral registers
Direct Populates opcode field with 16-bit address of the variable
example 1: MMOV32 MR1, @_VarA
example 2:
MMOV32 MR1, @_EPwm1Regs.CMPA.all
Indirect Uses the address in MAR0 or MAR1 to access memory;
after the read or write MAR0/MAR1 is incremented by a
16-bit signed value
example 1:
MMOV32 MR0, *MAR0[2]++
example 2: MMOV32 MR1, *MAR1[-2]++
CLA Task Assembly Code Example
.cdecls "Lab.h"
.sect "Cla1Prog"
_Cla1Task1: ; FIR filter
MUI16TOF32 MR2, @_AdcaResultRegs.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

Table of Contents

Other manuals for Texas Instruments TMS320F2837 D Series

Related product manuals