Motorola DSP Developer's Kit    

The Simulink MOT563_SMAX Example

Building the Simulink S-Function

To use the Simulink MOT563_MAX function binary in the NON_INTERACTIVE mode, compile the source code file

<matlab>/toolbox/motdsp/motdspmex/56300/mot563_smax.cpp.

To do so, enter at the MATLAB command line

You can now compile the Simulink MEX-file by typing the following command

This creates a mot563_smax library binary in the current directory.

Running the Simulink S-Function

A Simulink library is provided containing the Motorola DSP Developer's Kit Blocksets with links to the supplied motxxx_sxxxx.cpp S-functions. To run the MOTDSP563 max block, which is based on the mot563_smax.cpp S-function, you need to create a simple Simulink model. For more detailed information, see "Building a Simple Model" in Using Simulink.

To start Simulink, click the Simulink icon in the MATLAB toolbar, or type

at the MATLAB command line.

On Windows platforms, right-click the Motorola DSP Blockset listing in the Simulink Library Browser to open the Motorola DSP Developer's Kit Blockset. Then double-click the MOTDSP 56300 Blockset icon to open the DSP56300 Blockset.

On UNIX platforms, the Simulink library window opens immediately when you launch Simulink. Double-click on the Blocksets & Toolboxes icon in the Simulink window. The blockset and toolbox libraries appear. Now, double-click on the Motorola DSP Blockset icon to open the Motorola DSP Developer's Kit Blockset, and then double-click on the MOTDSP 56300 Blockset icon to open the DSP56300 Blockset.

Alternatively, to open the Motorola DSP Developer's Kit Blockset directly, type

at the MATLAB command line.

To create a new model, select New -> Model from the Simulink File menu. Then simply drag the MOTDSP563 max block from the MOTDSP 56300 Blockset library into the new model window to begin building the system. Use blocks from the Sources and from the Sinks libraries or expanded browser lists to complete your simple model.

Setting Block Parameters

Double-click on the MOTDSP563 max block. A window appears that lets you set the block's parameters. For this simple example, use the default settings and select Value from the Mode pop-up menu. This is the simplest operating mode of the MOTDSP563 max block, and returns the maximum value of the input only.

Close the window by clicking the OK button or by pressing Enter on the keyboard.

Select Start from the Simulation menu to start the simulation.


 Using Motorola DSP MEX-Files Using the Motorola DSP Developer's Kit