You are on page 1of 3

Getting started with CCS

Laurier Boulianne

September 21, 2006

1 Setting up CCS
This section states how to set up the program to use the C6713 board correctly. Usually,
you will only need to set this up once.

1 Before even starting Code Composer Studio, you have to make sure that it is configured
for the right board. That is why you need to run the setup program. The CCsetup
icon should be on your desktop, double click on it.

2 When you open the program, a window called Import Configuration should pop up. If
not, open it using the File → Import menu. Press the Clear button to remove any
previous configurations.

3 Now, select the ”C6713 DSK” configuration and click the Import button. Save and Quit,
and start CCS.

4 In CCS, there is a few options that are not set by default that you might want to activate.
Select the Option → Customize menu. In the Debug Properties tab, you can select
the ”Perform Go Main automatically” box and deselect the ”Open the Disassembly
Window automatically” box. In the Program Load Options tab, you can select
the ”Load Program After Build” and ”Clear All Breakpoints When Loading New
Programs”.

5 One last step before starting up your project, make sure that the Text-Based Linker is
selected. You can access the Linker Configuration window with the Tools → Linker
Configuration menu.

2 Creating your project


1 Create a new project by selecting the Project → New Menu. Make sure that the Project
Type is set to Executable (.out) and the Target is set to TMS320C67XX. You will
probably want to save your project in a new folder on your ”H” drive. Note: Since

1
your H drive is on the network, it is much slower than the main hard disk. This can
produce some weird errors when trying to compile or run a program with CCS. If it
happens, just copy your project directory to the main hard disk when you work on
it. Do not forget to copy it back to your H drive and delete your temporary project
when you are done.

2 Once your project is created, create a new CDB file. You can do so by selecting the File
→ New → DSP/BIOS Configuration menu. In the new window, select dsk6713.cdb.
The CDB file should pop up, save it in your project folder and add it to the project
by selecting the Project → Add Files to Project menu. The CDB file is used to
configure various parameters of the board like memory, cache, interrupts, I/O and so
on (more on that in the tutorials and the lab handout).

3 Using the same method, also add to the project the .CMD file that is present in your
project folder. The CMD file has been created when the CDB file was created.

4 You are now ready to write your program by adding c, h, and library files, just like you
would do with Visual Studio.

3 Configuring the audio codec


The following procedure allows you to process data in real-time. Note that for this code
to compile properly in CCS, you need to

1 add the library C:\CCS v3.1\c6000\dsk6713\lib\dsk6713bsl.lib to your project,

2 in the project settings, add C:\CCS v3.1\c6000\dsk6713\include to the header search


path, and

3 add the CHIP 6713 to the preprocessor symbol list in the Project Build Options.

The following code needs to be added in your program. First, include the two following
headers to your project.

#include <dsk6713.h>
#include <dsk6713_aic23.h>

Next, the configuration structure will set the various parameters of the audio codec
while the handle can be considered as a pointer to the audio codec.

DSK6713_AIC23_Config config = {
0x0017, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */
0x0017, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume */

2
0x01f9, /* 2 DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */
0x01f9, /* 3 DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */
0x0011, /* 4 DSK6713_AIC23_ANAPATH Analog audio path control */
0x0000, /* 5 DSK6713_AIC23_DIGPATH Digital audio path control */
0x0000, /* 6 DSK6713_AIC23_POWERDOWN Power down control */
0x0043, /* 7 DSK6713_AIC23_DIGIF Digital audio interface format */
0x0081, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control */
0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */
};
DSK6713_AIC23_CodecHandle hCodec;

In your main function, you first need to initialize the library and then open the codec
(with the configuration structure defined up above). You also need to set the sampling
frequency of the AIC23.

DSK6713_init();
hCodec = DSK6713_AIC23_openCodec(0,&config);
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_8KHZ);

To get the signal from the LINE IN, you just need to read the codec. Note that you
need to use the function two times, since the codec is stereo, we need to read the data
twice.

while(!DSK6713_AIC23_read(hCodec, &x1));
while(!DSK6713_AIC23_read(hCodec, &x2));

To write your result to the LINE OUT, a very similar function is used.

while(!DSK6713_AIC23_write(hCodec, y1));
while(!DSK6713_AIC23_write(hCodec, y1));

Finally, at the end of the program, you can close the codec when you do not need the
it anymore.

DSK6713_AIC23_closeCodec(hCodec);

You might also like