Sunteți pe pagina 1din 53

Lab Session on Introduction to Code Composer Studio

&
DSP Applications with the TMS320C6713 DSK

Outline of Laboratory
Introduction to Code Composer Studio Installation and setup of CCS Laboratory

Familiar with DSK6713 starter kit Creating a project and developing a simple Program Building options. Run and Debug a Program. Data Visualization

DSK Kit Components

Overview

Overview

DSK Details

Overview

It is intelligent IDE to offer DSP application development for multi processor, multi-user, multi-site projects.
It provides complier, assembler and linker in order to generate output file for any input algorithm file. It also helps us to download and run algorithm on DSK.

The development flow of most DSP-based applications consists of four basic phases: application design,code creation, debug, and analysis/tuning.

CCS Integrated Development Environment

Useful TI documentation (available online or on your hard drive):


SPRU509F.PDF CCS v3.1 IDE Getting Started Guide C6713DSK.HLP C6713 DSK specific help material

Note that your DSK includes CCS v3.1.

Code Composer Studio Toolbar

Overview
225 MHz TMS320C6713 floating point DSP Advance VLIW architecture with 8 different functional Units (6 ALUs & 2 Multiplers) Eight 32 bit instructions can be process simultaneously at every 4.44ns; In one second 8 x 2.25 x108 1800 millian instructions can be process per second; It is useful in computationally intensive algorithm (MIPS) 16 bit TLV320AIC23 Analog Interface Circuit stereo codec (ADC and DAC) Sigma delta technique with 12 Mhz clock 8-96 kHz sample rates can be selected Ideal for audio applications Memory 16 MB dynamic RAM 512 kB nonvolatile FLASH memory General purpose I/O 1.26 V for DSP core and 3.3 V for memory and peripherals 32 bit Address Bus so 4 GB address 4 LEDs 4 DIP switches USB interface to PC

Is my DSK working?
Power up DSK and watch LEDs Power On Self Test (POST) program stored in FLASH memory automatically executes POST takes 10-15 seconds to complete All DSK subsystems are automatically tested During POST, a 1kHz sinusoid is output from the AIC23 codec for 1 second Listen with headphones or watch on oscilloscope If POST is successful, all four LEDs blink 3 times and then remain on

Is my DSK working? DSK Diagnostic Utility

Code Composer Studio IDE


Connect power supply to DSK Wait for POST to complete Connect USB cable from PC to DSK
If this is the first time connecting the DSK, you may be asked to install a driver. The driver is on the Code Composer Studio CD and will automatically be found by Windows if the CD is in the drive.

Launch Code Composer Studio C6713 DSK CCS will load and wait for your input

CCS Integrated Development Environment

Useful TI documentation (available online or on your hard drive):


SPRU509F.PDF CCS v3.1 IDE Getting Started Guide C6713DSK.HLP C6713 DSK specific help material

Note that your DSK includes CCS v3.1.

Overview

Connecting to the C6713 DSK

Opening an Existing Project

Select a .PJT file and press Open. Chassaing example projects should be in c:\CCStudio_v3.1\myprojects\ Other example projects for the C6713 can be found in c:\CCStudio_v3.1\examples\dsk6713

Compiling/Building a Project

Loading and Running a Project on the C6713 DSK

Loading and Running a Project on the C6713 DSK

Halting a Running Program on the C6713 DSK

Build Options
Fixing the search path Add
C:\CCStudio_v3.1\C6000\dsk671 3\include

to the search

path
Project -> Build Options -> [Compiler tab] -> [Preprocessor category]

Build Options

Build Options

Build Options
Complier setting
Basic Category Target Version mv6710 Advance Category Memory Models to Far Preprocessor Category Predefine symbol CHIP_6713 Include search path

Linker Settings
Give Library Search path and directory name Give path to generate map and executable files

Debugging and Other Useful Features of the CCS IDE

Breakpoints Probe points Watch variables Plotting arrays of data Animation General Extension Language (GEL)

Build Options Suppress Linker Warnings

Breakpoints and Probe Points

Breakpoints

Watch Variables

Watch Variables

In the Watch Locals tab, the debugger automatically displays the Name, Value, and Type of the variables that are local to the currently executing function. In the Watch tab, the debugger displays the Name, Value, and Type of the local and global variables and expressions that you specify. Can add/delete tabs.

Graph Windows: Plotting Arrays of Data

FIR Filter

Creating FIR Filters

Creating FIR Filters

Creating FIR Filters

Filter Realization Structure

Filter Realization Structure

Compute FIR Filter Coefficients

Compute FIR Filter Coefficients

More Interesting Programs

Example we would like to design


Polls DIP switch 0. If pressed, light up all four LEDs. Sets the sampling rate of the AIC23 codec to 44.1kHz. Uses an ISR to sample the left and right channels. Multiplies the left and right channels by a variable gain. Outputs the modified samples to the left and right channels.

Directory Structure
1. myprojects: a folder supplied only for your projects. 2. bin: contains many utilities. 3. docs: contains documentation and manuals. 4. c6000\cgtools: contains code generation tools. 5. c6000\RTDX: contains support files for real-time data transfer. 6. c6000\bios: contains support files for DSP/BIOS. 7. examples: contains examples included with CCS. 8. tutorial: contains additional examples supplied with CCS.

Useful Types of Files


1. file.pjt: to create and build a project named file 2. file.c: C source program 3. file.asm: assembly source program created by the user, by the C compiler, or by the linear optimizer 4. file.sa: linear assembly source program. The linear optimizer uses file.sa as input to produce an assembly program file.asm 5. file.h: header support file 6. file.lib: library file, such as the run-time support library file rts6700.lib 7. file.cmd: linker command file that maps sections to memory 8. file.obj: object file created by the assembler 9. file.out: executable file created by the linker to be loaded and run on the C6713 processor - .coff format 10. file.cdb: configuration file when using DSP/BIOS

SUPPORT FILES
1. C6713dskinit.c: contains functions to initialize the DSK, the codec, the serial ports, and for I/O. It is not included with CCS. 2. C6713dskinit.h: header file with function prototypes. Features such as those used to select the mic input in lieu of line input and gain 3. C6713dsk.cmd: sample linker command file. This generic file can be changed when using external memory in lieu of internal memory. 4. Vectors_intr.asm: a modified version of a vector file included with CCS to handle interrupts. Twelve interrupts, INT4 through INT15, are available, and INT11 is selected within this vector file. They are used for interrupt-driven programs. 5. Vectors_poll.asm: vector file for programs using polling. 6. rts6700.lib,dsk6713bsl.lib,csl6713.lib: run-time, board, and chip support library files, respectively. These files are included with CCS and are located in C6000\cgtools\lib, C6000\dsk6713\lib, and c6000\bios\lib, respectively.

SUPPORT FILES
1. DSP Bios : enable us to develop sophisticated application more quickly better than traditional approach 2. CSL File- It provides c program function to configure and control on chip peripherals
manages standard protocol for program peripherals Basic resource management

3. BSL : Provides control on board devices and allowing developer to get algorithm functioning in a real system rts6700.lib,dsk6713bsl.lib,csl6713.lib: run-time, board, and chip support library files, respectively. These files are included with CCS and are located in C6000\cgtools\lib, C6000\dsk6713\lib, and c6000\bios\lib, respectively.

Examples for Demonstration


Example 1 Sine Generation Using Eight Points with DIP Switch Control. This example generates a sinusoid using a table lookup method.

Examples for Demonstration


Within the function main, another function, comm_poll, is called that is located in the communication and initialization support file c6713dskinit.c. It initializes the DSK, the AIC23 codec onboard the DSK, and the two McBSPs on the C6713 processor. Within c6713dskinit.c, the function DSK6713_init initializes the BSL file, which must be called before the two subsequent BSL functions, DSK6713_LED_init and DSK6713_DIP_init, are invoked that initialize the four LEDs and the four dip switches. When dip switch #0 is pressed, LED #0 turns on and the sinusoid is generated. Otherwise, DSK6713_DIP_get(0) will be false (true if the switch is pressed) and LED #0 will be off. The function output_sample, located in the communication support file C6713dskinit.c, is called to output the first data value in the buffer or table sine_table[0] = 0. The loop index is incremented until the end of the table is reached, after which it is reinitialized to zero.

Creating Project

Examples for Demonstration

1. Press the up-arrow key to increase the gain value from 10 to 15, as displayed in the Slider window. Verify that the volume of the sine wave generated has increased. 2. Press the up-arrow key again to continue increasing the slider, incrementing by 5 up to 30. The amplitude of the sine wave should be about 2.5 V pp with a gain value set at 30. 3. Change the sampling frequency from 8 to 16 kHz by setting fs in the C source program to DSK6713_AIC23_FREQ_16KHZ. Rebuild. The

Example 2: Generation of the Sinusoid and Plotting with CCS (sine8_buf)

Sine Stereo File


#include "dsk6713_aic23.h" //codec support Uint32 fs=DSK6713_AIC23_FREQ_8KHZ; //set sampling rate #define DSK6713_AIC23_INPUT_MIC 0x0015 #define DSK6713_AIC23_INPUT_LINE 0x0011 Uint16 inputsource=DSK6713_AIC23_INPUT_MIC; // select input #define LEFT 0 #define RIGHT 1 union {Uint32 uint; short channel[2];} AIC23_data; #define LOOPLENGTH 8 // size of look up table short sine_table_left[LOOPLENGTH]={0,7071,10000,7071,0,-7071,-10000,-7071}; // 3Khz short sine_table_right[LOOPLENGTH]={0,-7071,10000,-7071,0,7071,-10000,7071}; //1khz short loopindex = 0; // look up table index interrupt void c_int11() //interrupt service routine { AIC23_data.channel[RIGHT]=sine_table_right[loopindex]; //for right channel; AIC23_data.channel[LEFT]=sine_table_left[loopindex]; //for leftchannel; output_sample(AIC23_data.uint); //output to both channels if (++loopindex >= LOOPLENGTH) loopindex = 0; // check for end of look up table return; } void main() { comm_intr(); //init DSK,codec,McBSP while(1) ; //infinite loop }

Examples for Demonstration


Example 3: Loop with Data in a Buffer Printed to a File Example 4: Loop Program with Input Data Stored in Memory Example 5: Echo with Control for Different Effects (echo_control) with MIC control Example 6: Low Pass FIR Filter for three different frequencies Example 8: Band Stop IIR Filter Example 9: Adaptive Filter Design for noise cancellation Example 10: Interfacing between Matlab and CCS using RTDX (Real Time Data Exchange). It allows for data exchange between host PC and target DSK as well as analysis in real time without halting the target.

S-ar putea să vă placă și