EasyManuals Logo

Texas Instruments C28 Series Student Guide

Texas Instruments C28 Series
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 #336 background imageLoading...
Page #336 background image
Lab D: C Optimization
Lab D: C Optimization
Objective
The objective of this lab is to practice and verify the mechanics of optimizing C programs. Using
Code Composer Studio profile capabilities, different routines in a project will be benchmarked.
This will allow you to analyze the performance of different functions. This lab will highlight the
profiler and the clock tools in CCS.
Procedure
Create Project File
1. Create a new project in C:\C28x\Labs\Appendix\LabD called LabD.pjt and
add LabD.c, LabD.cmd, and sop-c.c to it. (Note that sop-asm.asm will be used
in the next part of the lab, and should not be added now). Also, add the compiler run-
time support library to the project
(C:\ti\c2000\cgtools\lib\rts2800_ml.lib).
2. Setup the Build Options. Select the Linker tab and in the middle of the screen select
“Run-time Autoinitialization” under “Autoinit Model:”. Create a
map file by typing .\Debug\LabD.map in the Map Filename [-m] field. Do
not enter anything in the “Code Entry Point (-e):” field (leave it blank). Set
the stack size to 0x400. Next, select the Compiler tab. Note that “Full Symbolic
Debug (-g)” under “Generate Debug Info:” in the Basic Category is
selected. On the Feedback Category pull down the interlisting options and select “C
and ASM (-ss)”. On the Assembly Category check the Keep generated .asm
Files (-k), Keep Labels as Symbols(-as) and Generate Assembly
Listing Files (-al). The –as will allow you to see symbols in the memory
window and the –al will generate an assembly listing file (.lst file). The listing file has
limited uses, but is sometime helpful to view opcode values and instruction sizes. (The
.lst file can be viewed with the editor). Both of these options will help with debugging.
Then select OK to save the Build Options.
Build and Load
3. Click the “Rebuild All” button and watch the tools run in the build window. Be
sure the “Load program after build” option is selected in Code Composer
Studio. The output file should automatically load. The Program Counter should be
pointing to _c_int00 in the Disassembly Window.
Set Up the Profile Session
4. Restart the DSP (debug restart) and then “Go Main”. This will run
through the C initialization routine in Boot.asm and stop at the main routine in
LabD.c.
5. Set a breakpoint on the NOP in the while(1) loop at the end of main() in LabD.c.
D- 14 C28x – C Programming

Table of Contents

Other manuals for Texas Instruments C28 Series

Questions and Answers:

Question and Answer IconNeed help?

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

Texas Instruments C28 Series Specifications

General IconGeneral
BrandTexas Instruments
ModelC28 Series
CategoryComputer Hardware
LanguageEnglish

Related product manuals