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 #246 background imageLoading...
Page #246 background image
Lab 9: CLA Floating-Point FIR Filter
9 - 22 TMS320F2837xD Microcontroller Workshop - Control Law Accelerator
Change Task 1 to FIR Filter in Assembly
Previously, the initialization and filter tasks were implemented in C. In this part, we will not be
using the C implementation of the FIR filter located at Task 1 in ClaTasks_C.cla. Instead,
we will add ClaTasks.asm to the project and use the assembly implementation of the FIR
filter located at Task 1 in this file. The CLA setup code in Cla_9.c and the filter initialization
C-code located at Task 8 in ClaTasks_C.cla will not need to change.
19. Open ClaTasks_C.cla and at the beginning of Task 1 change the #if preprocessor
directive from 1 to 0. The sections of code between the #if and #endif will not be
compiled. This has the same effect as commenting out this code. We need to do this to
avoid a conflict with the Task 1 in ClaTask.asm file.
20. Add (copy) ClaTasks.asm to project from C:\C28x\Labs\Lab9\source.
21. Open ClaTasks.asm and notice that the .cdecls directive is being used to include the C
header file in the CLA assembly file. Therefore, we can use the Peripheral Register
Header File references in the CLA assembly code. Next, notice Task 1 has been
configured to run an FIR filter. Within this code special instructions have been used to
convert the ADC result integer (i.e. the filter input) to floating-point and the floating-point
filter output back to integer. Notice at Task 2 the assembly preprocessor .if directive is
set to 0. The assembly preprocessor .endif directive is located at the end of Task 8.
With this setting, Tasks 2 through 8 will not be assembled, again avoiding a conflict with
Task 2 through 8 in the ClaTasks_C.cla file. Save all modified files.
Build and Load
22. Build the project by clicking Project Build Project, or by clicking on the
Build” button (if it has been added to the tool bar). Select Yes to “Reload the program
automatically”.
Run the Code Test the CLA Operation (Tasks in C and ASM)
23. Run the code in real-time mode using the Script function: Scripts Realtime
Emulation Control Run_Realtime_with_Reset, and watch the graph window
update. To confirm these are updated values, carefully remove and replace the jumper
wire to ADCINA0. (Remember the graph must be enabled for continuous refresh). The
results should be the same as before.
24. Fully halt the CPU (real-time mode) by using the Script function: Scripts
Realtime Emulation Control Full_Halt.
Change All Tasks to Assembly
In this part, we will be using the assembly implementation of the FIR filter and filter delay line
initialization routine located at Task 1 and Task 8, respectively, in the ClaTasks.asm file.
The setup in Cla_9.c will remain the same. The ClaTasks_C.cla is no longer needed
and will be excluded from the build. As a result, the CLA C compiler is not used and the CLA
C compiler scratchpad area allocated by the linker command file will not be needed.
25. Open ClaTasks.asm and at the beginning of Task 2 change the assembly preprocessor
.if directive to 1. Recall that the assembly preprocessor .endif directive is located at the
end of Task 8. Now Task 2 through Task 8 will be assembled, along with Task 1.
26. Exclude ClaTasks_C.cla from the project to avoid conflicts with ClaTasks.asm. In
the Project Explorer window right-click on ClaTasks_C.cla and select Exclude from
Build. This file is no longer needed since all of the tasks are now in ClaTasks.asm.

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