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 #299 background imageLoading...
Page #299 background image
OPTIONAL Lab B-C: Array Initialization in C
OPTIONAL Lab B-C: Array Initialization in C
Objective
The objective of this lab is to practice and verify the mechanics of initialization using C.
Additionally, we learn how to run and observe the operation of C code using Code Composer
Studio. In this lab, we will initialize the “vars” arrays with the contents of the “const” table.
Procedure
Create Project File
1. In Code Composer Studio create a new project called LabB-C.pjt in
C:\C28x\Labs\Appendix\LabB\LabB-C and add LabB-C.c, LabB-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 experiment and explore the various build options when
working with C.
Initialize Allocated RAM Array from ROM Initialization Table
2. Edit LabB-C.c and modify the “main” routine to copy table[9] to the allocated arrays of
data[4], coeff[4], and result[1]. (Note: data[9] consists of the allocated arrays of data, coeff,
and result).
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, it is helpful to see the values located in table[9] and data[9] at the same time. Open
two memory windows by using the “View Memory” button on the vertical toolbar and
using the address labels table and data. Setting the properties filed to “Hex – TI style”
will give you more viewable data in the window. Additionally, you can watch the CPU (and
Status) registers. Open the CPU core and status registers by using the “View CPU
Registers”. Deselect “Allow Docking” and move/resize the window as needed.
Check to see if the program is working as expected.
End of Exercise
C28x - Appendix B - Addressing Modes B - 17

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