lab 10 ti c6713 dsk introduction wls - unidesh · lab 10 ti c6713 dsk introduction wls.605 page 5...
TRANSCRIPT
LAB 10 TI C6713 DSK Introduction WLS.605
Page 1 of 13
Objective
• This document introduces you to using the Embedded Target for C6000 DSP with Real-
Time Workshop to develop digital signal processing applications for the Texas Instruments
C6000 family of DSP development hardware, such as the Texas Instrument TMS320C6713
Developer's Starter Kit.
• You will develop a simple reverberation (echo) system example and load it onto the Texas
Instrument TMS320C6713 Developer’s Starter Kit.
Introduction
For simplicity this tutorial will use the following abbreviations from this point forward:
Title Abbreviations
Digital Signal Processor DSP
Texas Instrument TI
TMS320C6713 Digital Signal Processor C6713 DSP
TMS320C6713 Developer’s Starter Kit C6713 DSK
Code Composer Studio CCS
Embedded Target for C6000 DSP C6x Target
Real-Time Workshop RTW
American National Standards Institute ANSI
DSP Hardware
Although all processors, such as the Intel Pentium 4 processor, have the ability to process digital
signals, not all of them can process digital signals equally well. DSP processors, such as the TI
C6713 DSP, are specifically designed to process digital signals well. Despite their differences,
however, there are many similarities among them. In the example shown in Figure 1 below, you
may relate the TI C6713 DSK components with those of a personal computer.
LAB 10 TI C6713 DSK Introduction WLS.605
Page 2 of 13
Figure 1: PC and C6713 DSK Analogy
DSP Software:
The TI C6713 DSK, like a personal computer, also needs to load software to establish its
behaviour and function. These software can be designed in a variety of approaches. The design
approach that the upcoming labs will follow is illustrated in Figure 2 below. The designer will
begin with a concept of what they want to program. The next step is to model the concept with
blocks from Simulink’s large collection of prewritten blocksets. Basically, a block diagram that
models the concept is built using Simulink. If a specific block required is not included in
Simulink’s blocksets, the designer may choose to write their own blocks from scratch using
Matlab. At this point the design is still not designed to operate on any specifically hardware. To
do that, the designer uses the C6x Target and RTW to generate (or build) ANSI C code intended
for the TI C6713 DSK. The C6x Target will then automatically take the generated ANSI C code
and uses the TI CCS tools to compile specific machine code and finally loads the targeted
machine code to the TI C6713 DSK hardware. For the experienced designer, they may choose to
directly write the ANSI C code.
LAB 10 TI C6713 DSK Introduction WLS.605
Page 3 of 13
Figure 2: Software design flow
Preparations:
1. Gather the following equipments.
• Computer with Simulink, CCS, C6x Target, and RTW installed
• TI C6713 DSK
• DSK power adapter
• DSK USB cable
• Microphone
• Speakers/Headphones
• TI Driver CD
Procedure:
In this tutorial you will create and build a model that simulates audio reverberation applied to an
input signal. Reverberation is similar to the echo effect that you can hear when you shout across
an open valley or canyon, or in a large empty room.
Part A: Building the Reverberation Model using Simulink
2. Open Matlab.
LAB 10 TI C6713 DSK Introduction WLS.605
Page 4 of 13
3. Click on to open Simulink Library Browser.
4. Create a new model by selecting File �New �Model from the Simulink menu.
Figure 3: Reverberation Simulink model.
5. You will build the reverberation model, as shown in Figure 3 above, from blocks located in the
Simulink Library Browser. From the Simulink Library Browser, double click on Signal
Processing Blockset �Signal Operations. Drag and drop the Delay block onto the new model
page.
6. Alternatively, you may type in the name of the block into the Find field located at the top of
the Simulink Library Browser menu to search for the block. Then drag-and-drop the block onto
the new model page. Try that approach for the Gain blocks.
7. Use either approach described in step 0 and 6, insert the remaining blocks listed in Table 1 into
the Simulink model:
Table 1: Remaining blocks
Block Name Block Location
C6713 DSK ADC Embedded Target for TI C6000 DSP→
C6713 DSK Board Support
C6713 DSK DAC Embedded Target for TI C6000 DSP→
C6713 DSK Board Support
Sum Simulink→Math Operations
8. The new Simulink model page should now look similar to that shown in Figure 4 below.
Figure 4: Inserting Simulink Blocks
LAB 10 TI C6713 DSK Introduction WLS.605
Page 5 of 13
9. Format the orientation of the blocks by right-clicking on the block →Format →Flip block or
Rotate block. Flip one of the Gain blocks as shown in Figure 5 below.
Figure 5: Formatting Block Orientation
10. Most Simulink blocks have parameters that can be adjusted by double-clicking on it. Adjust
all the blocks according to Table 2 summarized below. The result should be the same as shown in
Figure 6 below.
Table 2: Block Parameters
Block Name Block Parameters Parameter Value
C6713 DSK ADC
ADC Source:
+20 dB Mic gain Boost:
Stereo:
Sample rate:
Word length:
Output data type:
Scaling:
Samples per frame:
Mic In
No
Yes
48 kHz
20-bit
Single
Normalize
64
C6713 DSK DAC
Word length:
Scaling:
Overflow mode:
20-bit
Normalize
Saturate
Sum (left)
Icon shape:
List of signs:
Sample time:
Round
++|
-1 (inherited)
Sum (right)
Icon shape:
List of signs:
Sample time:
Round
|++
-1 (inherited)
Delay
Delay units:
Delay (frames):
Frames
140
Gain
Gain:
Multiplication:
Sample time:
0.8
Element-wise
-1 (inherited)
Gain1 Gain:
Multiplication:
Sample time:
0.9
Element-wise
-1 (inherited)
LAB 10 TI C6713 DSK Introduction WLS.605
Page 6 of 13
Figure 6: Adjusting Block Parameters
11. Now it is time to connect these blocks together using signal lines. Look closely at each of the
blocks for different orientations of the ‘>’ symbol. These are I/O ports. If the symbol is pointing
towards its own block then it is an input port. If the symbol is pointing away from its own block
then it is an output port. To direct signal from one block to another, left-click on the output port,
drag to the input port, and release the mouse button. To branch off of one signal line, right-click
on the signal line where the branch is to occur and drag to the port that it is intended to connect,
and then release the mouse button. Refer to Appendix A below for more signal line manipulation
actions. The result should be similar to that shown in Figure 7 below.
Figure 7: Complete Reverberation Model
Part B: Hardware Setup
12. CAUTION! First connect the power extension cord to the AC adapter, and then connect the
AC adapter to the C6713 DSK. This will prevent a sudden surge of power to the C6713 DSK that
can severely damage it. DO THIS FIRST!
13. Once the power is connected to the C6713 DSK, connect the remaining equipment to the
DSK as illustrated in Figure 8 below. DO THIS SECOND!
LAB 10 TI C6713 DSK Introduction WLS.605
Page 7 of 13
Figure 8: Reverberation Hardware Setup
14. Once the USB cable is connected to the computer and the C6713 DSK, the computer will
require a driver installation for the C6713 DSK. Insert the TI driver CD into the computer and
install the appropriate driver. Note: Select Install from a specific location and then choose to
Search for drivers in CD-ROM.
15. Run the 6713 DSK Diagnostics Utility (under Start→Programs→Texas
Instruments→Code Composer Studio ‘C6713 DSK Tools 2) to verify that the C6713 DSK
functions. Click Start and wait until the test is done. The result should appear similar to Figure 9
below.
LAB 10 TI C6713 DSK Introduction WLS.605
Page 8 of 13
Figure 9: 6713 DSK Diagnostics Results
16. All diagnostic tests, with the exception of the External Memory, should pass. If not,
disconnect the USB cable, reconnect the USB cable, reinstall the TI drivers, and then run the test
again.
Part C: TI C6x Target Configuration
17. With the Simulink model still opened, click on Simulation →Configuration parameters
and a dialog box opens.
18. On the Select pane, click on Solver.
19. The Solver pane allows you to:
• set the simulation start and stop times,
• choose the solver and specify its parameters, and
• select output options.
20. Set the start time to 0 and the stop time to 300. This will allow the C6713 DSK to run for 5
minutes.
LAB 10 TI C6713 DSK Introduction WLS.605
Page 9 of 13
21. From the Type option menu, select fixed-step. This will make the C6713 DSK output value
at each clock period even though the output value may not have changed.
22. Leave the other parameters as default. The result should be as shown in Figure 10 below.
Figure 10: Solver parameters
23. On the Select pane, click on Real-Time Workshop.
24. The RTW pane lets you set parameters that directly affect code generation and optimization.
The RTW pane also lets you initiate and control the build process, with the aid of the C6x Target.
25. On the Target selection pane, click on Browse. This opens the System Target File Browser.
The browser displays a list of all currently available target configurations. When you select a
target configuration, RTW automatically chooses the appropriate system target file, template
makefile, and make command specifically to the Hardware/Software.
26. Select the ti_c6000.tlc (Embedded Target for TI C6000 DSP (GRT)) entry in the list of
available configurations. The result should be as shown in Figure 11 below. Click OK to confirm
the selection.
LAB 10 TI C6713 DSK Introduction WLS.605
Page 10 of 13
Figure 11: Choosing the Target file
27. On the Select pane and under Real-Time Workshop, click on TI C6000 target selection.
28. Choose C6713DSK from the Code generation target type menu. This will select the codes
specific to the C6713DSK hardware.
29. On the Select pane and under Real-Time Workshop, click on TI C6000 runtime.
30. Choose build and_execute from the Build action menu.
31. Leave the other parameters as default.
32. Confirm that the current Matlab working directory is c:\matlab7\work as shown in Figure 12
below.
Figure 12: Matlab Current Working Directory
LAB 10 TI C6713 DSK Introduction WLS.605
Page 11 of 13
33. Click on the Increment Build button to order RTW to start building the Simulink
model into ANSI C code and then controlling CCS to build the executable file. Afterwards, RTW
will also automatically load the executable file into the C6713 DSK and run it.
Part D: Reverberation System Test
34. Once the executable is loaded into the C6713 DSK, speak into the microphone and listen for
the echo sound effect from the headphones.
35. Adjust the delay time of the delay block to 80 frames instead of 140 frames and rebuild the
model. What happens to the sound effect?
……………………………………………………………………………………………….
……………………………………………………………………………………………….
……………………………………………………………………………………………….
……………………………………………………………………………………………….
……………………………………………………………………………………………….
……………………………………………………………………………………………….
……………………………………………………………………………………………….
……………………………………………………………………………………………….
……………………………………………………………………………………………….
Summary
The following topics were covered in this tutorial. You may want to review these topics before
moving to the next lab.
• The similarities between general processing systems and the C6713 DSK.
• The concept to implementation design flow using Matlab, Simulink, RTW,C6x Target,
CCS, and the C6713 DSK.
• Building a Simulink model.
• Configuring a Simulink model for the C6713 DSK.
• Building ANSI C code from a Simulink model.
• Building executable from ANSI C code. Plus loading executable onto the C6713 DSK.
• Setting up the C6713 DSK hardware.
LAB 10 TI C6713 DSK Introduction WLS.605
Page 12 of 13
Appendix A: Summary of Mouse and Keyboard Actions
These tables summarize the use of the mouse and keyboard to manipulate blocks, lines, and
signal labels. If you have time, it is beneficial for you to become familiar with these editing
commands. LMB means press the left mouse button; CMB, the center mouse button; and RMB,
the right mouse button.
Manipulating Blocks
The following table lists mouse and keyboard actions that apply to blocks.
Task Microsoft Windows UNIX
Select one block LMB LMB
Select multiple blocks Shift + LMB Shift + LMB; or CMB alone
Copy block from another
window
Drag block Drag block
Move block Drag block Drag block
Duplicate block Ctrl + LMB and drag; or RMB
and drag
Ctrl + LMB and drag; or RMB
and drag
Connect blocks LMB LMB
Disconnect block Shift + drag block Shift + drag block; or CMB
and
drag
Open selected subsystem Enter Return
Go to parent of selected
subsystem
Esc Esc
Manipulating Lines
The following table lists mouse and keyboard actions that apply to lines.
Task Microsoft Windows UNIX
Select one line LMB LMB
Select multiple lines Shift + LMB Shift + LMB; or CMB alone
Draw branch line Ctrl + drag line; or RMB and
drag line
Ctrl + drag line; or RMB +
drag
line
Route lines around blocks Shift + draw line segments Shift + draw line segments; or
CMB and draw segments
Move line segment Drag segment Drag segment
Move vertex Drag vertex Drag vertex
Create line segments Shift + drag line Shift + drag line; or CMB +
drag line
LAB 10 TI C6713 DSK Introduction WLS.605
Page 13 of 13
Manipulating Signal Labels
The next table lists mouse and keyboard actions that apply to signal labels.
Task Microsoft Windows UNIX
Create signal label Double-click line, then enter
label
Double-click line, then enter
label
Copy signal label Ctrl + drag label Ctrl + drag label
Move signal label Drag label Drag label
Edit signal label Click in label, then edit Click in label, then edit
Delete signal label Shift + click label, then press
Delete
Shift + click label, then press
Delete
Manipulating Annotations
The next table lists mouse and keyboard actions that apply to annotations.
Task Microsoft Windows UNIX
Create annotation Double-click in diagram, then
enter text
Double-click in diagram, then
enter text
Copy annotation Ctrl + drag label Ctrl + drag label
Move annotation Drag label Drag label
Edit annotation Click in text, then edit Click in text, then edit
Delete annotation Shift + select annotation, then
press Delete
Shift + select annotation, then
press Delete