Embedded Target for Motorola MPC555 Previous page   Next Page

Using the Pass-Through Option in Simulation

Device driver blocks in the Embedded Target for Motorola MPC555 library have a unique pass-through option. This option lets you provide a signal from a device driver block for use in simulation.

Pass through drivers allow you to use the same model for

Using pass-through allows you to work in any of the 3 modes described above without any modifications to your model.

Pass-through I/O device drivers have two modes of operation. When used for Simulink closed-loop simulation, driver inputs are passed through to the controller. Driver outputs from the controller are passed through to the plant model, so you can create a feedback loop.

When the controller subsystem containing the pass through drivers is used for generating real-time code, the drivers operate in the second mode of operation; they function as I/O device drivers connected to hardware. Physical signals such as voltage are converted to a digital value, which is then used by the control algorithm.

The primary advantage of pass through driver technology is that it enables you to maintain a single model that can be used for closed-loop simulation in Simulink as well as for code generation where physical interfaces to external hardware require device drivers. This removes the need to maintain a simulation model separately from a controller/real-time model. You can examine an example of a pass-through driver block in this tutorial model.

Open the MIOS Digital Out block from the Target_LED subsystem. Make sure that the Enable pass through (show simulation input) option is selected, as shown in this picture.

When this option is enabled, an outport appears on the block. The block input is passed through to the output during simulation. This option affects simulation only.

To see the effect of pass-through in simulation,

  1. Open the Scope block in the root model.
  2. Start the simulation; observe the output signals from the Target_LED subsystem.
  3. Stop the simulation manually (the simulation time is set to inf).

For more information about how to use pass-through for single model simulation and deployment, we provide a demo. See MPC555 Fuelsys Demo with Pass Through Drivers.

The next step in this tutorial is generating code.


Previous page  The Example Model Generating Code Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2010 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS