MATLAB Examples

Getting Started with Embedded Coder Support Package for F28M3x Concerto Processors

This example shows you how to use Embedded Coder Support Package for Texas Instruments C2000 F28M3x Concerto Processors to run Simulink® models on F28M3x Concerto Processors.

Contents

Introduction

Embedded Coder™ Support Package for Texas Instruments C2000 F28M3x Concerto Processors enables you to create and run Simulink models on Texas Instruments C28x + ARM Cortex-M3 MCUs. The support package includes a library of Simulink blocks for configuring and accessing F28M3x peripherals and communication interfaces.

In this example you will learn how to configure a simple Simulink model to generate code for ARM and C28x cores of F28M3x processors and run the generated code on the board to periodically turn LEDs on and off.

Prerequisites

Required Hardware

To run this example you will need the following hardware with Texas Instruments XDS100v2 USB Emulator connection:

Task 1 - Configure model to run on ARM side of F28M3x

In this task, you will configure a simple model to run code on the ARM Cortex M3 core of the F28M3x processors.

1. Open the ARM LED model.

2. This Model is configured to run on the F28M35x ARM Cortex M3 CPU. You can run the model on F28M36x by changing the Hardware board to 'TI Concerto F28M36x (ARM Cortex-M3)' in the Configuration Parameters > Hardware Implementation pane.

3. The red LED (LD3) on the F28M35H52C control card is driven by PC7_GPIO71. Select GPIO group GPIOC and Pin number 7 on the Digital Output block placed in the model. The red LED (D2) on the F28M36P63C control card is driven by PF2_GPIO34. Select GPIO group GPIOF and Pin number 2 on the Digital Output block placed in the model.

4. You can configure the GPIOs from the Configuration Parameters > Hardware Implementation > Groups pane. By Default, all pins are enabled on the C28x if not used by the ARM Simulink Model.

4. On the Configuration Parameters > Hardware Implementation pane, make sure the Build action is set to Build, load and run with 'Boot From Flash (stand alone execution)' enabled.

5. Press Ctrl+B to build, load and run the application on the hardware board. Observe that the red LED is blinking with a 1 second period.

Task 2 - Configure model to run on C28x CPU of F28M3x

In this task, you will configure a simple model to run on C28x side of F28M3x processors. Before starting application on C28x CPU (RAM or Flash), there should be an application loaded and running on the ARM side that configures the clock settings for C28x CPU. You can do this by running the above ARM LED model.

1. Open the C28x LED model.

2. This Model is configured to run on the F28M35x C28x CPU. You can run the model on F28M36x by changing the Hardware board to 'TI Concerto F28M36x (C28x)' in the Configuration Parameters > Hardware Implementation pane.

3. The red LED (LD2) on the F28M35H52C control card is driven by PC6_GPIO70. Select GPIO70 under GPIO group GPIO68~GPIO71 on the Digital Output block placed in the model. The red LED (D1) on the F28M36P63C control card is driven by PE7_GPIO31. Select GPIO31 under GPIO group GPIO24~GPIO31 on the Digital Output block placed in the model.

4. On the Configuration Parameters > Hardware Implementation pane, make sure the Build action is set to Build, load and run with 'Boot From Flash (stand alone execution)' enabled.

5. Press Ctrl+B to build and load the application to the target. Observe that the red LED LD2 on the board is ON for 0.5 second and OFF for 0.5 second.

Summary

This example introduced the workflow for running a Simulink model on the F28M3x Concerto board.