Signal Monitoring and Parameter Tuning Using Infineon AURIX TC3x Microcontrollers
This example shows how to use Embedded Coder® Support Package for Infineon® AURIX™ TC3x Microcontrollers in Monitor and Tune mode (External mode) using Infineon AURIX TC3x hardware board.
Introduction
Monitor and Tune feature enables parameter tuning and data logging while the model is running on the target hardware in real time. When you change parameter values within Simulink, the modified parameter values are communicated to the target hardware immediately. You can monitor the effects of the parameters tuning activity by viewing the signals on the Simulation Data Inspector and Dashboard Scope. When you are prototyping and developing algorithms, it is useful to monitor signals and tune parameters while the algorithms are running on the hardware.
In this example you will learn how to configure a simple Simulink model to monitor and tune the simulations.
Prerequisites
Complete the following tutorials:
Required Hardware
Infineon AURIX TC375 Lite Kit
Available Model
Monitor and Tune of Infineon AURIX TC3x
The Infineon AURIX TC3x hardware supports Monitor and Tuning over Serial (ASCLIN0) and DAS. Simulink provides the following additional features for the targets:
Dashboard objects such as Slider and Dashboard Scope
Simulation Data Inspector (SDI) for visualizing the logged signals
Prepare the model and simulate by following the below steps:
1. Open the tc3x_external_mode model.
2. Specify the COM Port. To see the list of available COM ports on your computer, select Start > Control Panel > Device Manager > Ports (COM &LPT).
3. In your Simulink model, press Ctrl+E or click Modeling > Model Settings to open Configuration Parameters dialog box. Navigate to Hardware Implementation > Target hardware resources > Connectivity. Select Connectivity interface as 'Serial(ASCLIN0)' for external mode.
4. Go to Hardware tab, and click Monitor & Tune to configure the model for simulation.
At this point, your model runs on the Infineon AURIX TC375 Lite Kit and communicates with Simulink from Monitor & Tune. You can select the Simulation > Data Inspector button to view the logged signals, as shown:
4. You can tune the parameters and visualize the signals selected for logging by:
Double-clicking the Manual Switch block to change the input source.
Using the Slider to change the signal gain
Double-clicking the Scope block to view the simulation results
Double-clicking the Manual Switch block to turn ON and OFF the LED
The model runs in real-time on the target while performing these actions.
5. Stop Monitor & Tune simulation by clicking the Stop button, as shown:
Stopping the Monitor & Tune simulation terminates the execution of the code running on the Infineon AURIX TC375 Lite Kit.
Note: At any point during the course of the simulation, you can open the External Mode Control Panel. The Hardware > control panel provides more options, such as the ability to connect or disconnect to the target without terminating the execution of the generated code.
Other Things to Try
Run the example on different Infineon AURIX TC3x Microcontrollers by changing the package class and pinout options and analyze the results.