HIL Verification of IIR Filter via SCI

This example shows HIL verification of an IIR filter using serial communication interface between a host simulation and generated code on a TI C28x processor.

Required hardware:

On the following boards the embedded xds100 JTAG can be used as a serial connection over USB. Jumper and switch settings with appropriate FTDI drivers are required to use this serial communication technique.

Available versions of this example:

This example model c2000scitest.mdl can be used for all boards.

Contents

Host Model

The following figure shows the host model:

Target Model

The following figure shows the target model:

Description

This example shows HIL verification of an IIR filter using serial communication interface between a host simulation and generated code on an c28x processor-based target board.

Based on the position of the manual switch, either a saw-tooth or sine waveform is passed to the Host-side SCI Transmit block and sent to the target. The stream of data is received from the target the via Host-side SCI Receive block and sent to the Simulink® scope block.

The same algorithm runs on the target and the host side at the same time. The scope displays three signals showing the result of the simulation compared with the result of the algorithm running on the target. Because the algorithm uses an IIR filter, its output is therefore dependent on every sample time that occurs from the beginning of the simulation. Using an IIR filter clearly shows the time consistency between the simulation and the generated code.

You can add a delay in the simulation by using the "Show Delayed Output" switch. This delay can be used to verify the time consistency between both models.

Hardware Connections

How to Run the Example

The following sections explain how to configure, build, and deploy the executable.

Note: the host model is set to use "COM1". The "SCI Setup", "SCI Transmit" and "SCI Receive" blocks have to be configured to a different COM port if needed.

With Code Composer Studio v3.3 (CCSv3.3) - Default

Change the manual switch position to select a different input signal.

With Code Composer Studio v4 (CCSv4)

CCSv4 support is provided via a makefile based approach. This requires running xmakefilesetup to set the environment. You can ignore the following if you have already gone through these steps. For more information, please refer to the Xmakefile Documentation

  1. C:\Program Files\Texas Instruments\ccsv4\ for "CCS Installation".
  2. C:\Program Files\Texas Instruments\ccsv4\tools\compiler\C2000\ for "Code Generation Tools".
  3. C:\Program Files\Texas Instruments\bios_5_41_10_36\ for "DSP/BIOS Installation".

Code Generation and Creation of an .out file using CCSv4:

Change the manual switch position to select a different input signal.

With Code Composer Studio v5 (CCSv5)

CCSv5 support is provided via a makefile based approach. This requires running xmakefilesetup to set the environment. You can ignore the following if you have already gone through these steps. For more information, please refer to the Xmakefile Documentation

  1. C:\ti\ccsv5\ for "CCS Installation".
  2. C:\ti\ccsv5\tools\compiler\c2000\ for "Code Generation Tools".
  3. C:\ti\bios_5_41_11_38\ for "DSP/BIOS Installation".

Code Generation and Creation of an .out file using CCSv5:

Change the manual switch position to select a different input signal.