Lab Session
November 23, 2022 | Author: Anonymous | Category: N/A
Short Description
Download Lab Session...
Description
Lab Session on Introduction to Code Composer Studio
&
DSP Applications with the TMS320C6713 DSK
Outline of Laboratory • Intro Introduction duction 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 multi-site projects.
processor,
multi-user,
• It provides complier, assembler and linker in order to
generate output file for any input al algorithm gorithm 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 ALUs & 2 Multiplers) • Eight 32 bit instructions can be process simultaneously at e every very 4.44ns; In one
second 8 x 2.25 x108 ≈ 1800 millian instructions can be b e process per second; It is useful in computationally intensive algorithm (MIPS) • 16 bit TL TLV320AIC23 V320AIC23 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? • Powe Powerr up DSK and watch LEDs • Power On Self Test (POST) program stored in FLASH
memory automatically executes • POST takes takes 10-15 seconds to complete • All DSK subsystems s ubsystems 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. 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. c:\CC Studio_v3.1\myprojects 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 the search path • Add C:\CCStudio_v3.1\C6000\dsk671 3\include
to the sear search ch
path Project -> Build Options -> [Compiler tab] -> [Preprocessor [Pr eprocessor category]
Build Options
Build Options
Build Options • Complier setting – Basic Category – Target Version –mv6710 – Advance Category – Memory Models to Far Far – Prepr Preprocessor ocessor Category – Predefine symbol CHI CHIP_6713 P_6713 – Include search path
• Link Linker er Sett Settings ings – 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, Value, and Type of the variables that are local to
the currently executing currently executing function. • In the Watch Watch tab, the debugger displays the Name, Name, Value, and Type Type of the llocal ocal and and global variables and expressions expressions that that you 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 lik like e 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\R c6000\RTDX: TDX: 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 so urce program created by the user, 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 i ncluded with CCS. 2. C6713dskinit.h: header file with function prototypes. Features 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 memory.. 4. Vectors_intr.asm: a modified version of a vector file included with CCS to handle interrupts. Twelve Twelve interrupts, INT4 through INT15, are available, and INT11 is sel selected ected within this vector file. They are used for interrupt-driven programs. 5. Vectors_poll.asm: Vectors_poll.asm: vector file for programs using polling. 6. rts6700.lib,dsk6713bsl. rts6700.lib,dsk6713bsl.lib,csl6713.lib: lib,csl6713.lib: run-time, board, and and chip chip support library files, respectively. respectively. These fil files es 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 sophisticated application application more quickly better than traditional approach 2. CSL File- It It provides c program function to configure 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: rts6700.lib,dsk6713bsl.lib,csl6713.li b: run-time, board, and chip support library files, respectively. These files are included with CCS and are located in C6000\cgtoo C6000\cgtools\lib, ls\lib, C6000\dsk6713\lib, C6000\dsk6713\lib, and c6000\bios\lib, respectively.
Examples for Demonstration • Example 1 Sine Generation Using Eight Points with DIP Switch Control. This 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 DSK6713_init initializes the BSL file, which must be called before the two subsequent BSL subsequent BSL functions, DSK6713_LED_init DSK6713_LED_in it and DSK6713_DIP_init, are invoke invoked d that initialize initi alize 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_g DSK6713_DIP_get(0) et(0) will be false (true if the switch is pressed) and LED #0 will be off.
• The function output_sample, output_sample, located in the communication 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 reach reached, ed, after which it is i s reinitialized to zero.
Creating Project
Examples for Demonstration
1. Press Press the the up-ar up-arro row w key key to to increase increase the gain gain val value ue from 10 to 15, as displayed in the Slider window. Verify that the volume of the sine wave generated has increased. 2. Press Press the the up-ar up-arro row w key key again again to to continue continue incr increasing easing 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 Change the the sampli sampling ng fr frequ equenc ency y from from 8 to to 16 kHz kHz by
setting fs in the C source program to DSK6713_AIC23_FREQ_16KHZ. DSK6713_AIC23_FREQ _16KHZ. Rebuild. Rebuild. The The
Example 2: Generation of the Sinusoid and Plotting with CCS (sine8_buf)
Sine Stereo File #include "dsk6713_ #include "dsk6713_aic23 aic23.h" .h" //codec //codec support support Uint32 fs=DSK6713_AIC23_FREQ_8KHZ; 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; 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 sine_table_left[LOOPLENGTH]={0,7071,10 ]={0,7071,10000,7071,0,000,7071,0,-7071,-10000, 7071,-10000,-7071}; -7071}; // 3Khz short sine_table_right[LOOPLENGTH]={0 sine_table_right[LOOPLENGTH]={0,-7071,10000 ,-7071,10000,-7071,0,707 ,-7071,0,7071,-10000,707 1,-10000,7071}; 1}; //1khz short loopindex = 0; // look up table index interrupt void c_int11() //interrupt service service routine { AIC23_data.channel[RIGHT]=sine_table_right[ AIC23_data.channel[ RIGHT]=sine_table_right[loopindex]; loopindex]; //for right channel; AIC23_data.channel[LEFT]=sine_table_ AIC23_data.channel[ LEFT]=sine_table_left[loopindex]; left[loopindex]; //for leftchannel; leftchannel; output_sample(AIC23_data.uint); //output to both channels output_sample(AIC23_data.uint); if (++loopindex >= LOOPLENG LOOPLENGTH) TH) loopindex = 0; // check for end of look up table return; } void main() { comm_intr(); //init DSK,codec,McBSP while(1) ; //infinite loop }
Examples for Demonstrat Demonstration ion • 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.
View more...
Comments