Vous êtes sur la page 1sur 11

ES 10 207: DESIGN OF DIGITAL SIGNAL PROCESSING SYSTEMS LABORATORY

Familiarization of TMS320C6713 DSK & Code Composer Studio (CCS)


The DSP processors (DSPs) offer wide range of applications from image processing
to communications such as cellular phones, printers, digital cameras, MP3 players and so on.
DSP TMS320C6713 manufactured and designed by Texas Instruments. DSPs such as
TMS320C6x are special purpose microprocessors by TI with specialized architecture which
is well suited for numerical intensive calculations.
The TMS320C6713 DSP is very powerful by itself, but for development of programs,
a supporting architecture is required to store programs and data and to bring signals on and
off the board. In order to use DSP, a circuit board is provided that contains appropriate
components. Together, Code Composer Studio (CCS), DSP chip, and supporting hardware
make up the DSP starter kit (DSK)
TMS320C6713 DSK DSP Board highlights
Texas Instruments TMS320C6713 DSP operating at 225 MHz
16-bit stereo codec AIC23 with sampling frequency of 8 KHz to 96 KHz
8 Mbytes of onboard SDRAM (Synchronous Dynamic RAM)
512 KB of non-volatile Flash memory
4 user accessible LEDs and DIP switches
Configurable boot options
Standard expansion connectors for daughter card use
JTAG emulation through on-board JTAG emulator with USB host interface or
external emulator
Single voltage power supply (+5V)

Figure 1: Typical lab setup


1

ES 10 207: DESIGN OF DIGITAL SIGNAL PROCESSING SYSTEMS LABORATORY

Functional Overview of TMS320C6713 DSK DSP Board


The DSP on the 6713 DSK interfaces to on-board peripherals through a 32-bit wide
EMIF (External Memory Interface). The SDRAM, Flash and CPLD are all connected to the
bus. EMIF signals are also used for daughter cards. The DSP interfaces to analog audio
signals through an on-board AIC23 codec and four 3.5 mm audio jacks (microphone input,
line input, line output, and headphone output). The codec can select the microphone or the
line input as the active input. The analog output is sent to both the line out and headphone out
connectors. The line out has a fixed gain, while the headphone out allows for an adjustable
gain.
A programmable logic device called a CPLD (Complex Programmable Logic Device)
is used to implement logic that ties the board components together. The DSK includes 4
LEDs and a 4 position DIP switch which allow for interactive feedback.

Figure 2: TMS320C 6713 DSK block diagram


Code Composer Studio (CCS) Software
CCS software tool is used to generate TMS320C6x executable files. CCS is used to
write, compile and download code on to the TMS320C6713 DSK. CCS includes a C
compiler, an assembler and a linker. It also has graphical abilities and supports real-time
debugging. Figure 3 shows the intermediate steps involved for going from a source file to an
executable file. In the absence of target board the simulator can be used to verify the code
functionality.

ES 10 207: DESIGN OF DIGITAL SIGNAL PROCESSING SYSTEMS LABORATORY

Figure 3: C6x CCS Software Tool


A PC is required to run Code Composer Studio which is required to compile and
download code to (run on) the DSP. The compiler compiles a C source program with
extension .c to produce an assembly source file with extension .asm. The assembler
assembles an.asm source file to produce a machine language object file with extension .obj.
The linker combines object files and object libraries to produce an executable file with
extension .out. This executable file represents a linked common object file format
(COFF).This executable file can be loaded and run directly on the TMS320C6713 DSP.

ES 10 207: DESIGN OF DIGITAL SIGNAL PROCESSING SYSTEMS LABORATORY

Module-1: DSP Fundamentals with TMS320C6713 DSK


Experiment No. 1: Linear Convolution
AIM
To write a program to implement convolution of x(n) with h(n) using linear
convolution and verify the result y(n) as below.
x(n)={1,1,1,1,0.5,0.5,0.5,0.5}; h(n)={0.3,0.25,0.2,0.15,0.1,0.05} and
y(n)= {0.3, 0.55, 0.75, 0.9, 0.85, 0.775, 0.675, 0.6, 0.4, 0.25, 0.15, 0.075, 0.025}
PROGRAM
#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include<stdio.h>
#include <math.h>
void main()
{
float x[20]={1,1,1,1,0.5,0.5,0.5,0.5},h[20]={0.3,0.25,0.2,0.15,0.1,0.05};
float y[20]={0.0};
int n,k,xn,yn,i,j,l;
DSK6713_init();
printf("Enter the number of elements in x(n) \n");
scanf("%d",&xn);
printf("Enter the number of elements in h(n) \n");
scanf("%d",&yn);
l=xn+yn-1;// Calculating the total length of y(n)
//-------------------------------------------------for(i=xn;i<l;i++)
x[i]=0.0; //Padding zeroes to x(n)
printf("\n");
for(k=0;k<l;k++)
printf("%0.3f,",x[k]);//Printing x(n)
printf("\n"); //Newline
//-------------------------------------------------for(j=yn;j<l;j++)
h[j]=0.0; //Padding zeroes to h(n)

ES 10 207: DESIGN OF DIGITAL SIGNAL PROCESSING SYSTEMS LABORATORY

for(k=0;k<l;k++)
printf("%0.3f,",h[k]);//Printing h(n)
printf("\n"); //Newline
//-------------------------------------------------for(n=0;n<l;n++)
{
y[n]=0;
for(k=0;k<=n;k++)
y[n]=y[n]+x[k]*h[n-k]; //Calculation of Linear Convolution
printf("%0.3f\t",y[n]);
}
}
RESULT

Experiment No. 2: Circular Convolution


AIM
To write a program for circular convolution of the following inputs x(n) and h(n)
verify the output y(n) as below.
x(n)= {1,1,1,2,1,1}; h(n)= {1,1,2,1} and y(n)= {6, 5, 5, 6, 6, 7}
PROGRAM
#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include <math.h>
#include <stdio.h>
void main()
{
float x[20]={1,1,1,2,1,1};
float h[20]={1,1,2,1};
float y[20];
int i,j,k,t,xn,yn,l;
DSK6713_init();
printf("Enter the number of elements in x(n) \n");
scanf("%d",&xn);
printf("Enter the number of elements in h(n) \n");
scanf("%d",&yn);
//---------------------------------------5

ES 10 207: DESIGN OF DIGITAL SIGNAL PROCESSING SYSTEMS LABORATORY

if (xn>=yn)
l=xn;
// Finding the length of y(n)
else
l=yn;
//----------------------------------------for(i=xn;i<l;i++)
x[i]=0.0; //Padding zeroes to x(n)
printf("\n");
for(k=0;k<l;k++)
printf("%0.3f,",x[k]);//Printing x(n)
printf("\n"); //Newline
//-------------------------------------------------for(j=yn;j<l;j++)
h[j]=0.0; //Padding zeroes to h(n)
for(k=0;k<l;k++)
printf("%0.3f,",h[k]);//Printing h(n)
printf("\n");
//------------------------------------------------for(i=0;i<(xn/2);i++)
{
t=x[i];
x[i]=x[(xn-1)-i];
// Reversing x(n)
x[(xn-1)-i]=t;
}
//-------------------------------------------------for(i=0;i<l;i++)
{
y[i]=0;
//-------------------------------------t=x[l-1];
for(k=(l-1);k>0;k--) //Circular shifting x(n) by one position towards left
x[k]=x[k-1];
x[0]=t;
//------------------------------------for(j=0;j<l;j++)
y[i]=y[i]+h[j]*x[j]; // Multipying shifted x(n) with h(n)
printf("%.2f\t",y[i]);
}
}

ES 10 207: DESIGN OF DIGITAL SIGNAL PROCESSING SYSTEMS LABORATORY

RESULT

Experiment No. 3: DFT


AIM
To implement an 8-point DFT for the input x(n) and verify the result as X(K). Where,
x(n)= {1,1,1,1,1,1,0,0} and X(K)= {6, -0.707-j1.707, 1-j, 0.707+j0.293, 0, 0.707-j0.293, 1+j,
-0.707+j1.707}
PROGRAM
#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include<stdio.h>
#include<math.h>
#define pi 3.14
void main()
{
float x[20]={1,1,1,1,1,1,0,0};
float real[20];
float imag[20];
int k,n,N;
DSK6713_init();
//----------------------------------------printf("Enter the length of DFT \n"); //Input Length of DFT
scanf("%d",&N);
//----------------------------------------for(k=0;k<N;k++)
{
real[k]=0;
imag[k]=0;
for(n=0;n<N;n++)
{
real[k]+=x[n]*cos(2*pi*n*k/N); //Calculating real part of X(k)
imag[k]-=x[n]*sin(2*pi*n*k/N); //Calculating imaginary part of X(k)
}
}
for(k=0;k<N;k++)
printf("%.3f+j%.3f\t",real[k],imag[k]);
}
RESULT

ES 10 207: DESIGN OF DIGITAL SIGNAL PROCESSING SYSTEMS LABORATORY

Experiment No. 4: IDFT


AIM
To find the IDFT of the sequence X(K) ={1,1,1,1,0,0,0,0}. Verify that x(n)= {0.5,
0.125+ j0.30175, 0, 0.125+j0.05175, 0, 0.125-j0.05175, 0, 0.125-j0.30175}
PROGRAM
#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include<stdio.h>
#include<math.h>
#define pi 3.14159
void main()
{
float X[20]={1,1,1,1,0,0,0,0};
float real[20];
float imag[20];
int k,n,N;
DSK6713_init();
//----------------------------------------printf("\nEnter the length of x(n) \n"); //Input Length of x(n)
scanf("%d",&N);
//----------------------------------------for(k=0;k<N;k++)
{
real[k]=0;
imag[k]=0;
for(n=0;n<N;n++)
{
real[k]+=X[n]*cos(2*pi*n*k/N); //Calculating real part of X(k)
imag[k]+=X[n]*sin(2*pi*n*k/N); //Calculating imaginary part of X(k)
}
}
for(k=0;k<N;k++)
printf("%.3f+j%.3f\t",(0.125*real[k]),(0.125*imag[k]));
}
RESULT

ES 10 207: DESIGN OF DIGITAL SIGNAL PROCESSING SYSTEMS LABORATORY

Experiment No. 5: Signal Generation


AIM
To generate the following waveforms using the TLV320AIC23 codec on
TMS320C6713DSK and verify the outputs for different frequencies
1) Sine wave
2) Square wave
C PROGRAM FOR SINE WAVE GENEARTION
#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include <math.h>
/* Codec configuration settings */
DSK6713_AIC23_Config config = {
0x0017, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */
0x0017, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume
*/

};

0x00d8,
0x00d8,
0x0011,
0x0000,
0x0000,
0x0043,
0x0081,
0x0001

/*
/*
/*
/*
/*
/*
/*
/*

2
3
4
5
6
7
8
9

DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */


DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */
DSK6713_AIC23_ANAPATH Analog audio path control */
DSK6713_AIC23_DIGPATH Digital audio path control */
DSK6713_AIC23_POWERDOWN Power down control */
DSK6713_AIC23_DIGIF Digital audio interface format */
DSK6713_AIC23_SAMPLERATE Sample rate control (48 kHz) */
DSK6713_AIC23_DIGACT Digital interface activation */

void main()
{
int i;
DSK6713_AIC23_CodecHandle hCodec;
/* Initialize the board support library, must be 1st BSL call*/
/* dsk6713_init() must be called before other BSL functions */
DSK6713_init();
/* Start/open the codec */
hCodec = DSK6713_AIC23_openCodec(0, &config);
/* Change the sampling rate to 96 kHz */
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_96KHZ);
for (;;)
{
for(i=0; i<=2000; i++)
while(!DSK6713_AIC23_write(hCodec, 0X4FFE*sin(2*3.14*i)/2000)));
}
}

RESULT

ES 10 207: DESIGN OF DIGITAL SIGNAL PROCESSING SYSTEMS LABORATORY

C PROGRAM FOR SQUARE WAVE GENEARTION


#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include <math.h>
/* Codec configuration settings */
DSK6713_AIC23_Config config = {
0x0017, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */
0x0017, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume
*/

};

0x00d8,
0x00d8,
0x0011,
0x0000,
0x0000,
0x0043,
0x0081,
0x0001

/*
/*
/*
/*
/*
/*
/*
/*

2
3
4
5
6
7
8
9

DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */


DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */
DSK6713_AIC23_ANAPATH Analog audio path control */
DSK6713_AIC23_DIGPATH Digital audio path control */
DSK6713_AIC23_POWERDOWN Power down control */
DSK6713_AIC23_DIGIF Digital audio interface format */
DSK6713_AIC23_SAMPLERATE Sample rate control (48 kHz) */
DSK6713_AIC23_DIGACT Digital interface activation */

void main()
{
int i;
DSK6713_AIC23_CodecHandle hCodec;
/* Initialize the board support library, must be 1st BSL call*/
/* dsk6713_init() must be called before other BSL functions */
DSK6713_init();
/* Start/open the codec */
hCodec = DSK6713_AIC23_openCodec(0, &config);
/* Change the sampling rate to 96 kHz */
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_96KHZ);
for (;;)
{
for(i=0; i<=20; i++)
while(!DSK6713_AIC23_write(hCodec, 0X0000));
for(i=0; i<=20; i++)
while(!DSK6713_AIC23_write(hCodec, 0X7FFE));3
}
}

RESULT
Experiment No. 6: Tone Generation
AIM
To generate a simple tone of fixed frequency using serial port and TLV320AIC23
codec of the TMS320C6713DSK.
C PROGRAM FOR SIMPLE TONE GENEARTION
10

ES 10 207: DESIGN OF DIGITAL SIGNAL PROCESSING SYSTEMS LABORATORY

#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include <math.h>
/* Codec configuration settings */
DSK6713_AIC23_Config config = {
0x0017, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */
0x0017, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume
*/

};

0x00d8,
0x00d8,
0x0011,
0x0000,
0x0000,
0x0043,
0x0081,
0x0001

/*
/*
/*
/*
/*
/*
/*
/*

2
3
4
5
6
7
8
9

DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */


DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */
DSK6713_AIC23_ANAPATH Analog audio path control */
DSK6713_AIC23_DIGPATH Digital audio path control */
DSK6713_AIC23_POWERDOWN Power down control */
DSK6713_AIC23_DIGIF Digital audio interface format */
DSK6713_AIC23_SAMPLERATE Sample rate control (48 kHz) */
DSK6713_AIC23_DIGACT Digital interface activation */

void main()
{
int i;
DSK6713_AIC23_CodecHandle hCodec;
/* Initialize the board support library, must be 1st BSL call*/
/* dsk6713_init() must be called before other BSL functions */
DSK6713_init();
/* Start/open the codec */
hCodec = DSK6713_AIC23_openCodec(0, &config);
/* Change the sampling rate to 96 kHz */
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_96KHZ);
for (;;)
{
for(i=0; i<=2000; i++)
while(!DSK6713_AIC23_write(hCodec, 0X4FFE*sin(2*3.14*i)/2000)));
}
}

RESULT

11

Vous aimerez peut-être aussi