Embedded Target for Motorola MPC555    

Using the Demo Model In a PIL Cosimulation

In this section, we will plug the Configurable Subsystem into the demo model, select the PIL component, and use it in a PIL co- simulation:

  1. Click on the fuel_lib library window to activate it. Double-click on the button labeled Replace the original subsystem in the model with the configurable subsystem from this library.
  2. The mpc555pil_fuelsys model window is now the active window. The original fuel rate controller subsystem has been deleted from the model. It has been replaced by the Configurable Subsystem from the fuel_lib library. The Configurable Subsystem is automatically connected to the same signals that the original fuel rate controller subsystem was connected to.

  1. Save the model.
  2. Right-click on the Configurable Subsystem in the model. A context menu appears. Select the Block choice menu item and observe the block choice submenu. This figure shows the default block choice selection.

  1. From the Block choice submenu of the context menu, select fuel rate controller (PIL).
  2. Open the model's two Scope blocks, if they are not already opened.
  3. Make sure that Simulink is in Normal mode.
  4. You are now ready to run the cosimulation. To start the cosimulation, click the Start simulation button in the Simulink toolbar.
  1. The target system now starts executing the controller code. Observe that the output signals computed on the target are displayed on the scopes. The updating of the Scope blocks is slow, relative to a normal simulation, because data is transmitted over the serial line on every model step.

    Notice also that one of the green LEDs on the PhyCORE-MPC555 board blinks while the cosimulation runs.

  1. When the simulation completes, the LED stops blinking. The signals displayed on the scopes should appear as shown in Figure 2-2.

Figure 2-2: Signals Displayed at End of Simulation or Cosimulation

  1. When the cosimulation has completed, or has stopped or paused, the target code enters a wait state until it receives a command to start (or resume) from the host. Restart the cosimulation by clicking the Start simulation button again. You can start, stop, restart, pause, or continue a cosimulation exactly as you would a normal simulation. Try each of these operations a few times.
  2. Stop the cosimulation (or let it complete) and activate your cross-development system. Terminate the program on the target system, and exit your cross-development system.

Note that you can open the project and executable files, created by the PIL target for your cross-development system, at any time. You can then reload and run the target code, and run another cosimulation. See Build Process Files and Directories for information on the files and directories created by the build process.


  Building PIL and Simulation Components Tutorial 2: Modifying and Rebuilding the Controller