You are on page 1of 9

# Experiment 4

## Generation of Sinusoid using the TMS320C6713 DSP Starter Kit (DSK).

In this experiment we will learn how to generate a sinusoidal waveform using a table
lookup method. It will also at the same time familiarize us with the usage of the TI
Interactive Development Environment (IDE) i.e. the Code Composer Studio (CCS) for
assisting us in the development of dsp algorithms on the TMS320C6713 dsp chip.

## TMS320C6713 DSP Starter Kit (DSK).

This kit is a single board special purpose computer system design to test digital signal
processing programs to be implemented and executed in real-time. It is a complete DSP
system with a C6713 floating-point digital signal processor and a 32-bit stereo codec
TLV320AIC23(AIC23) for analog input and analog output

Objective

##  Familiarization with DSK and TI Code Composer Studio. (CCS).

 Generating a sinusoid using the table look up method.

Background to Sampling

If a sine wave of frequency 1kHz with an amplitude of 1000 is sampled at the rate of
8kHz, we will the following periods:-
Period of sine wave = 1/1000=0.001 sec.
Sampling period =1/8000=0.000125 sec.
Notice that during the singe period of the sine wave we will have 8 samples each
separated at equally space time of 0.000125 sec.

## The sampled waveform

f
x  1000 Sine(2n )
fs
is shown below.

From this we can build up the table for the amplitude of the sine wave at value of
n=0,1,2,3,4,5,6 & 7 to cover one period of the sine wave.
Procedure

## Section 1: Create Project.

Connect the line out (using the audio jack) to an oscilloscope or speaker.
Make sure that the DSK Board is connected to the Desktop Computer through the UBS
port and that the dc power supply of 5v is connected to the DSK Board.
Power up the desktop computer until the XP window is running.
Then switch on the dc power supply to the DSK board.

## 1. Launch CCS by Double clicking the icon

2. Creating project file exp4.pjt.
Select Project New.
Type exp4 for the project name.
Location: C:\CCStudio_v3.1\MyProjects\exp4\
Select Project Type as Executable (.out)
Select Target as TMS320C67xx.

## 3. Adding files to the project.

Select Project Add Files to Project.
Look in folder sine8_buf for file sine8_buf.c.
Double click on sine8_buf.c to add it to the project.
( LAB363 ‘sine8_buf’ folder ‘sine8_buf.c’ notepad )

## Select Project Add Files to Project.

Look in folder support for file C6713dskinit.c.
Double click on C6713dskinit.c to add it to the project.
( LAB363 ‘sine8_buf’ folder ‘C6713dskinit.c’ notepad )
4. Select Project Add Files to Project, use the pull-down menu for Files of type,
select ASM Source Files. Double click on the assembly source file vectors_intr.asm to
add it to the project.

5. Select Project Add Files to Project, use the pull-down menu for Files of type,
select Linker Command File. Double click on the file C6713dsk.cmd to add it to the
project.

6. Select Project Add Files to Project, use the pull-down menu for Files of type,
select Object and Library Files. Double click on the run-time support library file
rts6700.lib to add it to the project.
( C:\CCStudio_v3.1\c6000\cgtools\lib rts6700.lib )

7. Select Project Add Files to Project, use the pull-down menu for Files of type,
select Object and Library Files. Double click on the board support library (BSL) file
dsk6713bsl.lib to add it to the project.
( C:\CCStudio_v3.1\c6000\dsk6713\lib dsk6713bsl.lib )

8. Select Project Add Files to Project, use the pull-down menu for Files of type,
select Object and Library Files. Double click on the chip support library (CSL) file
csl6713.lib to add it to the project.
( C:\CCStudio_v3.1\c6000\csl\lib csl6713.lib )

9. Verify from the File window that the project(.pjt) file, linker command file (.cmd), the
three library (.lib) files, the two C source (.c) files and the assembly (.asm) file have been
added to the project.

10. Select Project Scan All File Dependencies . This will add/include the header
files c6713dskinit.h, along with several board and chip support header files included with
CCS.

## Section 2: CCS Build Options.

1. Before you can successfully build your project, you need to specify the relevant
options for the compiler and linker.

a) Compiler Option:-
 Select Project Build Option
 Select Compiler Tab.
Under the Compiler Tab:-
o Select Basic under the Category sub window.
Select :-
Target Version : C671x(-mv6710).
Generate Debug Info : Full Symbolic Debug (-g).
Opt Speed vs Size : Speed Most Critical (no –ms).
Opt Level : None.
Program Level Opt : None.

##  Select Preprocessor under the Category sub window.

For Include Search Path (-i): Type
C:\CCStudio_v3.1\MyProjects\LAB363\sine8_buf\ Support
For Pre-Define Symbols(-d): Type CHIP_6713
For Undefine Symbol(-u): Leave blank
For Preprocessing: Select None.

##  Select Advance under the Category sub window.

For Memory Models: Select Far(--mem_model:data=far)

b) Linker Option:-
 Select Linker Tab
Under the Linker Tab:-
o Select Basic.
For Stack Size(-stack): type 800.

## Section3. Building Your Program.

After you build your project, include (header) files appear in the Project View.
Now that you have created a functional program, you can build it. Use the Build All
function the first time you build the project. An output window will show the build
process and status. When the build is finished, the output window will display
Build complete 0 errors, 0 warnings.
The Rebuild All command is mainly used to rebuild the project when the project options
or any files in the project have changed.

## (Project Rebuild All)

Section 4. Loading Your Program.

## Before loading, you need to select Debug Connect.

After the program has been built successfully, load the program by going to
File Load Program. By default, Code Composer Studio IDE will create a
subdirectory called Debug within your project directory and store the .out file in it. Select
exp4.out and click Open to load the program.
(File Load Program exp4.out)

Note:
Remember to reload the program by choosing File Reload Program if you rebuild the
project after making changes.
.
Section 5. Running the Executable file exp4.out.

Select Debug Run or use the toolbar with the “running man”. Connect a speaker or
scope to the LINE OUT connector on the DSK.
Verify that a 1 KHz sinusoid waveform is generated.

## Sect ion 6. Plotting with CCS.

Halt the DSK by selecting Debug Halt or the “stop running man” icon.

The output buffer is continuously being updated every 256 points. We can use the CCS to
plot the current output data stored in the out_buffer.

## Select View Graph Time/Frequency. Change the graph Property Dialog as

follows:-
Display FFT graph using CCS:

## Select View Graph Time/Frequency. Change the graph Property Dialog as

follows:-
Select Window Tile Vertically.

Project Assignment:-

Write a program to generate a cosine with frequency of 666.66 Hz. Use the same
sampling frequency of 8000Hz. Verify your output result using LINE OUT, and plotting
the generated cosine in both time and the frequency domains.