Embedded Target for Texas Instruments C6000 DSPs | ![]() ![]() |
C6711 DSK Tutorial 2-4--A More Complex Application
For this tutorial, we demonstrate an application that uses multiple stages--using wavelets to remove noise from a noisy signal. The model name is c6711dskwdnoisf
. As with any model file, you can run this denoising demonstration by typing c6711dskwdnoisf
at the MATLAB prompt. The model also appears in the MATLAB demos collection. Here is a picture of the model as it appears in the demonstration library.
Unlike the audio reverberation tutorial model (C6711 DSK Tutorial 2-3--Single Rate Application), this model is difficult to build from blocks in Simulink. It uses complicated subsystems for the Delay Alignment block and the Soft Threshold block. For this tutorial you work with a copy of the demonstration model, rather than creating the model.
This tutorial takes you through generating C code and building an executable program from the demonstration model. The resulting program runs on your C6711 DSK as an executable COFF file.
Working and Build Directories
It is convenient to work with a local copy of the c6711dskwdnoisf
model, stored in its own directory, that you name (something like c6711dskwdnoisfex)
. This discussion assumes that the c6711dskwdnoisf
directory resides on drive d:
. Use a different drive letter if necessary for your machine. Set up your working directory as follows:
c6711dskwdnoisfex
your working directory in MATLAB.
c6711dskwdnoisf
model.
c6711dskwdnoisf
model as d:/c6711dskwdnoisfex/dnoisfrtw.mdl
.
During code generation, Real-Time Workshop creates a build directory within your working directory. The `build directory name is model_target_rtw
, derived from the name of your source model and your chosen target. In the build directory, Real-Time Workshop stores generated source code and other files created during the build process. You examine the contents of the build directory at the end of this tutorial.
Setting Simulink Simulation Parameters
To generate code correctly from the dnoisfrtw
model, you must change some of the simulation parameters. In particular, Real-Time Workshop uses a fixed-step solver. To set the parameters, use the Simulation Parameters dialog as follows:
Figure 2-10 shows the Solver pane with the correct parameter settings.
Figure 2-10: Solver Pane of Simulation Parameters Dialog
Selecting the Target Configuration
To specify the desired target configuration, you choose a system target file, which specifies the appropriate template makefile, and make
command.
In these tutorials, you do not need to specify these parameters individually. Instead, you use the ready-to-run ti_c6000.tlc target configuration.
Target configuration
from Category.
Figure 2-11: Real-Time Workshop Pane (Target Configuration Category)
Figure 2-12: Selecting Your Target in the System Target File Browser
ti_c6000.tlc
(as in Figure 2-12) and click OK.
ti_c6000.tlc)
, Template makefile (ti_c6000.tmf
), and Make command (make_rtw
), as shown in Figure 2-11.
General code generation options
from the Category list. The options displayed here are common to all target configurations. Check to make sure that all options are set to their defaults, as below.
TLC debugging
from Category. Clear all the check boxes in this category.
TI C6000 compiler
from Category. The options displayed here are specific to the C6711 DSK target. Check to make sure that the options are set as shown below.
TI C6000 linker
from Category. Set the linker options as shown.
TI C6000 runtime
from Category. Set the run-time options as shown.
Building and Running Your Model
The Real-Time Workshop build process generates C code from the model, and then compiles and links the generated program.
dnoisfrtw.exe
. In addition, Real-Time Workshop created a build directory, dnoisfrtw_c6000_rtw.
dir
at the MATLAB command prompt.
!
" character passes the command that follows it to the operating system, which runs the stand-alone dnoisfrtw
program.
Contents of the Build Directory
The build process creates a build directory and names it modelname_target_rtw
, concatenating the name of your source model and your chosen target. In this example, your build directory is named dnoisfrtw_c6000_rtw.
dnoisfrtw_c6000_rtw contains these generated source code files:
dnoisfrtw.c
--the stand-alone C code that implements the model.
dnoisfrtw.h
--an include header file containing information about the state variables
dnoisfrtw_export.h
--an include header file containing information about exported signals and parameters
The build directory also contains other files used or generated in the build process, such as the object (.obj
) files, the command file (.cmd
), and the generated makefile (dnoisfrtw.mk
).
![]() | Running Models on Your C6711 DSK | Creating Code Composer Studio Projects Without Building | ![]() |