Main Content

Get Started with IO Device Builder

IO Device Builder app in C2000™ Microcontroller Blockset allows you to quickly create a System object™ for custom or third-party source files (C/C++). You can use the System object to create a Simulink block using MATLAB System block.

System Requirements

To use the IO Device Builder, you need the following MathWorks®products:

Open IO Device Builder

To open the IO Device Builder app, follow these steps.

  1. Start MATLAB® and then open / create a Simulink® model.

  2. On the Hardware tab of the Simulink toolstrip, in the Prepare section, under Design, choose IO Device Builder.

    open IO device builder

    IO device builder welcome screen

  3. In the Welcome screen, click Next.

Select Working Directory and Add Third-party Source Files

Once the Source files location page loads, click Select to select the working directory.

The specified directory is where you can find the generated System object, along with the corresponding cpp and h files, as well as the model.

Source files location

Click Add folder to add the folder where the third-party source and header files exist. Note that all subfolders must be added separately, as they will not be considered automatically.

Note

Third-party source files can be downloaded from the internet. For example, to add ADXL345 files, download the source files for ADXL345 sensor.

Click Next.

Source Files

Once the Source Files select the required source files and then click Next to continue.

source files

Add Block Name, Block Description, and Add Block Parameters

In the Block parameters page, specify a name, add description, and add the required parameters for the block.

block parameters

  1. Specify a name for the block in Block Name textbox.

  2. Enter a description for the block in Block description textbox.

  3. Add the required parameters for the block using Add and Remove buttons. Use Move up and Move down buttons to move the selected parameters up / down in the list. For more information on selecting the parameter, see Verify Frequency of PLLRAW Clock Using IO Device Builder App.

  4. Click Next to move to the next page.

Add Outputs for the Block

In the Outputs page, add the required output ports for the block.

select outputs for block

After adding the required output ports, click Next to move to the next page.

Add Inputs for the Block

In the Inputs page, add the required input ports for the block.

select inputs for block

After adding the required input ports, click Next to move to the next page.

Preview Block Image

In the Preview page, a preview image of the block is shown along with the outputs and inputs your added.

model diagram with output

Click Next to move to the next page.

Generate System Object Files

In the Generate page, click Generate to generate the system object files for the block.

Note

Ensure that Select to generate a C++ driver option is not selected, as C++ is not supported for TI C2000 boards.

model diagram with output

Next Steps

In the Next steps page, information to update the setup and step methods are mentioned. Click Finish to complete the process.

  • The generated C file opens automatically.

  • Modify the generated C files' step and setup function with the respective function calls from the third-party source files.

  • Open the generated model to view the created block. You can add the rest of the algorithm to this model and configure the hardware board to Texas Instruments®C2000 hardware, or copy the block to a different model where the algorithm is developed.

model diagram with output