Motorola DSP Developer's Kit | ![]() ![]() |
The MATLAB MOT563_MAX Example
The MOT563_MAX
function and the MOT563_SMAX
S-function block provided in the Motorola DSP56300 Toolbox and Blockset are used as simple examples to illustrate some basic NON_INTERACTIVE mode features. These basic features include:
This tutorial assumes you have configured your environment as per Building Motorola DSP MEX-Files.
Building the MATLAB Function
To use the MATLAB MOT563_MAX
function binary in the NON_INTERACTIVE mode, compile the source code file
<matlab>/toolbox/motdsp/motdsp/56300/mot563_max.cpp.
To do so, enter at the MATLAB command line
cd <matlab>/toolbox/motdsp/motdspmex
You can now compile the MATLAB MEX-file by typing the following command
mex -v -f ./motdsp_mexopts3xx.sh ../motdsp/56300/mot563_max.cpp
This creates a mot563_max
library binary in the current directory.
Running the MATLAB MEX-File
To run the MATLAB MEX-file with a simple example input variable, enter
x = rand(10,1) y = mot563_max(x)
at the MATLAB command line. This returns the contents of the output variable, y, as determined by the default DSP processor of the DSP56300 family, to the MATLAB workspace.
Optional Command Line Arguments
Note The default DSP processor for the 56300 DSP family is the 56301. Similarly, for the 56600 DSP family, the default processor is the 56602. |
To change the DSP processor type within a selected DSP family, you must provide a string as an `optional' input argument at the MATLAB command line. For example,
y = mot563_max(x,'56307')
If the chosen DSP device does not exist an error message such as
Unable to create DSP device. DevNo:0 DevPart: DSP56399 21 Error in ==> <matlab>/toolbox/motdsp/motdsp/mot563_max.dll
Similarly, to select a simulator command file, you must provide a string as an `optional' input argument at the MATLAB command line. For example, type
y = mot563_max(x,'my_commands.cmd')
where my_commands.cmd
is a valid simulator command file in the current directory or on the MATLAB path. For more information on command files, see What You Provide.
![]() | Custom Build Process | The Simulink MOT563_SMAX Example | ![]() |