OPTIONAL Lab C-C: Sum-of-Products in C
C - 22
C28x - Appendix C - Assembly Programming
OPTIONAL Lab C-C: Sum-of-Products in C
Objective
The objective of this lab is to practice and verify the mechanics of performing C programming
arithmetic on the TMS320C28x. The objective will be to add the code necessary to obtain the
sum of the products of the n-th values from each array.
Procedure
Create Project File
1. In Code Composer Studio create a new project called
LabC-C.pjt
in
C:\C28x\Labs\Appendix\LabC\LabC-C
and add
LabC-C.c
,
LabC-C.cmd
and
C:\ti\c2000\cgtools\lib\rts2800_ml.lib
to it. Check your file list to
make sure all the files are there.
Do not
setup any Build Options. The default values will
be used. In Appendix Lab D exercise, we will experiement and explore the various build
options when working with C.
Sum of Products using a MAC-based Implementation
2. Edit
LabC-C.c
and modify the “main” routine to perform a MAC-based
implementation in C. Since the MAC operation requires one array to be in program
memory, the initialization routine can skip the transfer of one of the arrays, thus reducing
the amount of data RAM and cycles required for initialization.
Build and Load
3. Click
the
“Rebuild All”
button and watch the tools run in the build window. Debug
as necessary.
Note:
Have Code Composer Studio automatically load the output file after a successful build. On
the menu bar click:
Option Customize…
and select the
“Program Load Options”
tab,
check “Load Program After Build”
, then click
OK
.
4.
Under
Debug
on the menu bar click
“Go Main”
. Single-step your routine. While
single-stepping, open memory windows to see the values located in
table [9]
and
data
[9]
. (Note:
data[9]
consists of the allocated arrays of
data
,
coeff
, and
result
). Open the
CPU Registers. Check to see if the program is working as expected. Debug and modify,
if needed.
End of Exercise
Summary of Contents for C28 Series
Page 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Page 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Page 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Page 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Page 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Page 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Page 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Page 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Page 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Page 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...