Main Content

Model Configuration Parameters for Simulink Support Package for Arduino Hardware

Hardware Implementation Pane Overview

Configuration Parameters dialog box for Arduino hardware

  1. In the Modeling tab of the Simulink® Editor, click Model Settings.

  2. In the Configuration Parameter dialog box, click Hardware Implementation.

  3. Set the Hardware board parameter to a value such as Arduino Mega 2560.

  4. The parameter values under Hardware board settings are automatically populated to their default values.

    You can optionally adjust these parameters for your particular use case.

  5. Click Apply to apply the changes.

For more information on selecting a hardware support package and general configuration settings, see Hardware Implementation Pane.

See Also

Hardware board

Select the hardware board upon which to run your model.

Changing this parameter updates the dialog box display so that it displays parameters that are relevant to your hardware board.

To install support for a hardware board, start the Support Package Installer by selecting Get Hardware Support Packages. Alternatively, in the MATLAB® Command Window, enter supportPackageInstaller.

After installing support for a hardware board, reopen the Configuration Parameters dialog box and select the hardware board.

Settings

Default: None if the specified system target file is ert.tlc, realtime.tlc, or autosar.tlc. Otherwise, the default is Determine by Code Generation system target file.

None

No hardware board is specified. The system target file specified for the model is ert.tlc, realtime.tlc, or autosar.tlc.

Determine by Code Generation system target file

Specifies that the system target file setting determines the hardware board.

Get Hardware Support Packages

Invokes the Support Package Installer. After you install a hardware support package, the list includes relevant hardware board names.

Hardware board name

Specifies the hardware board to use to implement the system this model represents.

Tips

  • When you select a hardware board, parameters for board settings appear in the dialog box display.

  • After you select a hardware board, you can select a device vendor and type.

Dependencies

The Device vendor and Device type parameter values reflect available device support for the selected hardware board.

When you select a hardware board, the selection potentially changes the Toolchain parameter value and other configuration parameter values. For example, if you change the hardware board selection to ARM Cortex-A9 (QEMU), the Toolchain parameter value changes to a supported toolchain, such as Linaro Toolchain v4.8.

Command-Line Information

Parameter: HardwareBoard
Type: character array
Default: 'Determine by Code Generation system target file'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Build Options

ParameterDescriptionDefault Value
Build action

Option to specify whether you want only build or build, load, and run actions during code generation.

Build, load, and run

Disable parallel buildOption to compile the generated code and driver source codes in parallel order for faster build and deployment speed.off
Enable force rebuild of static libraryOption to create Arduino® library files only when the Simulink model is compiled for the first time for faster build and deployment speed.off
Verbose outputProvide additional diagnostics on host machine COM ports detection and Simulink model deployment on Arduino board.off
Terminate Teensy Loader application post deploymentClose Teensy Loader application after deploying a Simulink model on your Arduino Teensy hardware board.off

Host-board connection

ParameterDescriptionDefault Value

Application download

Set host COM portAutomatically detect, manually select, or manually specify the COM port of your host computer to communicate with the Arduino board.Automatically
BaudrateSelect the maximum speed of downloading a Simulink model executable on your Arduino board in bits per second.115200
Application Download BaudrateSelect the maximum speed of downloading a Simulink model executable on your Arduino board in bits per second.115200(Default-New Bootloader)
Bootloader COM PortEnter the new COM port of the bootloader. 

Connected I/O communication

Hardware Serial PortSelect the serial port of your Arduino board.Serial 0
Set host COM portAutomatically detect, manually select, or manually specify the COM port of your host computer to communicate with the Arduino board.Automatically
BaudrateSelect the maximum speed of downloading a Simulink model executable on your Arduino board in bits per second.921600

External Model over Serial communication

Hardware Serial PortSelect the serial port of your Arduino board.Serial 0
Set host COM portAutomatically detect, manually select, or manually specify the COM port of your host computer to communicate with the Arduino board.Automatically
BaudrateSelect the maximum speed of downloading a Simulink model executable on your Arduino board in bits per second.921600

PIL communication

Hardware Serial PortSelect the serial port of your Arduino board.Serial 0
Set host COM portAutomatically detect, manually select, or manually specify the COM port of your host computer to communicate with the Arduino board.Automatically
BaudrateSelect the maximum speed of downloading a PIL executable of the Simulink model on your Arduino board in bits per second.921600

Connected IO

ParameterDescriptionDefault Value
Connected IO mode

Select the Connected I/O mode.

auto
Action on data loss for source blocksSelect the action required for data loss on source blocks.warning

Overrun detection

ParameterDescriptionDefault Value
Enable overrun detectionOption to enable overrun detectionNot selected
Digital output to set on overrunDigital hardware pin to notify an overrun13

Analog input channel properties

ParameterDescriptionDefault Value
Analog input reference voltage

Option to set the reference voltage used to measure inputs to the ANALOG IN pins.

Default

Serial port properties

ParameterDescriptionDefault Value
Serial 0 baud rate, Serial 1 baud rate, Serial 2 baud rate, Serial 3 baud rate

Options to set the baud rate of the serial port on the Arduino hardware.

9600
Serial 0 Configuration, Serial 1 Configuration, Serial 2 Configuration, Serial 3 ConfigurationData frame configuration for serial communicationSERIAL_8N1
Serial 0 TX pinTransmitter pin number for serial port 01
Serial 0 RX pinReceiver pin number for serial port 03
Serial 1 TX pinTransmitter pin number for serial port 133
Serial 1 RX pinReceiver pin number for serial port 132
Serial 2 TX pinTransmitter pin number for serial port 217
Serial 2 RX pinReceiver pin number for serial port 216

I2C properties

ParameterDescriptionDefault Value
I2C Bus speed (Hz)

Option to specify the rate of data communication between the peripherals connected by the I2C bus

100000
I2C SDA pinSerial data pin number of Arduino board for I2C communication21
I2C SCL pinSerial clock pin number of Arduino board for I2C communication22

SPI properties

ParameterDescriptionDefault Value
SPI clock out frequency (in MHz)

Option to select a value from the list of controller clock frequency to obtain an SPI clock frequency.

4000
SPI mode

Options to set an SPI mode for data transmission.

Mode 0 – Clock Polarity 0, Clock Phase 0
Bit order

Options to select the bit order for transmissions.

MSB first
SD Card SPI SS pin

Chip Select (CS) pin that your SD card shield uses for SPI communication with the connected SD card.

4
CAN SPI SS pinChip Select (CS) pin that your CAN shield uses for SPI communication.3
SPI SDO pinSerial data out (SDO) pin of Arduino board for SPI communication23
SPI SDI pinSerial data in (SDI) pin of Arduino board for SPI communication19
SPI SCK pinSerial clock pin of Arduino board for SPI communication18
SD Card SPI CS pinChip select (CS) pin of SD card for SPI communication5

Ethernet shield properties

ParameterDescriptionDefault Value
Use static IP address and disable DHCP

Option to disable the DHCP.

Selected
IP address (Ethernet shield)

The IP address of the Arduino Ethernet shield.

192.168.0.20
MAC address

The machine address of the Arduino Ethernet shield.

DE:AD:BE:EF:FE:ED

WiFi properties

ParameterDescriptionDefault Value
WiFi hardwareSelect the WiFi hardware that you use for Wi-Fi connectivity.WiFi shield
Use static IP address and disable DHCP

Option to disable the DHCP.

Not selected
IP address

Enter the IP address of the Arduino WiFi shield.

192.168.1.20
Service set identifier (SSID)The SSID of your network. yourNetwork
WiFi encryption

The WiFi encryption of the network to which you are connected.

None
WPA passwordThe WPA password of the network. secretPassword
Hardware Serial PortSelect the port on the Arduino board that is connected to ESP8266.Serial 0
UsernameUsername of the WPA2 Enterprise credential.username
PasswordPassword of the WPA2 Enterprise credential.password
IP address assignmentSelect a method to assign IP address to your Arduino hardware board.DHCP
DNS server addressAddress for domain name system (DNS) server

192.168.1.0

Gateway addressIP address of the default gateway

192.168.1.0

Subnet maskSubnet mask of the network

255.255.255.0

ThingSpeak properties

ParameterDescriptionDefault Value
Connect to custom ThingSpeak serverThe option to connect to the custom ThingSpeak server. Otherwise, the ThingSpeak block connects to the default address of 184.106.153.149 through port 80.Selected
Server IP address

Specify the IP address of the custom ThingSpeak server.

184.106.153.149
Port

Specify the port number through which the ThingSpeak block connects to the ThingSpeak server.

80

MQTT properties

ParameterDescriptionDefault Value
Broker serviceMQTT broker service providerThingSpeak
Broker addressMQTT broker web addressmqtt3.thingspeak.com
PortMQTT broker port number1883
UsernameMQTT client username<empty>
PasswordMQTT client password<empty>
Client IDMQTT client identification number<empty>

Event system

ParameterDescriptionDefault Value
Enable EVSYS channel 0, 1, 2, 3Event channel to route events from the channel generator to the channel useroff
Channel generatorPeripheral trigger that is the source of the event generatorTCC0 overflow
Channel userPeripheral user who utilizes the event generator trigger on the channelADC start conversion

External mode

ParameterDescriptionDefault Value
Communication interface

Options that you can select for the ThingSpeak block to connect to the ThingSpeak server.

Serial — For AVR-based boards.

XCP on Serial — For ARM-based boards.

Host interface

Interface through which host computer communicates to target hardware for signal monitoring and parameter tuning.

Note

This parameter appears only if you choose XCP on Serial as the Communication interface.

Simulink

Use a dedicated timer to improve time stamp accuracyEnable the parameter to use a dedicated timer to improve the accuracy of the time stamps.on
Set logging buffer size automaticallyAutomatically set the number of bytes to preallocate for the buffer in the hardware during simulation.

on

Logging buffer size (in bytes)Specify the memory buffer size for XCP-based External mode simulation.2048
VerboseThe option to view the External Mode execution progress and updates in the Diagnostic Viewer or in the MATLAB Command Window. Not selected
Set XCP target polling timeSet XCP-based target polling time for Simulink models automatically or manually.Automatically
Polling time (in seconds)Enter polling time in seconds.2

CAN properties

ParameterDescriptionDefault Value
CAN Bus Speed (kBit/s)Bus speed in kilo bits per second.500
Oscillator Frequency (MHz)Oscillator frequency in mega hertz.16
Interrupt PinInterrupt pin value to enable reading the message.12
Allow All MessagesOption to allow all messages.Off
Buffer 0 ID TypeBuffer 0 id type.Normal
Buffer 0 Acceptance Mask (RXMO)Value for buffer 0 acceptance mask (RXMO).0
Buffer 0 Acceptance Filter (RXF0)Value for buffer 0 acceptance filter (RXF0).255
Buffer 0 Acceptance Filter (RXF1)Value for buffer 0 acceptance filter (RXF1).255
Buffer 1 ID TypeBuffer 1 id type.Normal
Buffer 1 Acceptance Mask (RXM1)Value for buffer 1 acceptance mask (RXM1).0
Buffer 1 Acceptance Filter (RXF2)Value for buffer 1 acceptance filter (RXF2).255
Buffer 1 Acceptance Filter (RXF3)Specify a value for buffer 1 acceptance filter (RXF3).255
Buffer 1 Acceptance Filter (RXF4)Value for buffer 1 acceptance filter (RXF4).255
Buffer 1 Acceptance Filter (RXF5)Value for buffer 1 acceptance filter (RXF5).255

On-board CAN properties

ParameterDescriptionDefault Value
CAN Bus Speed (kBits/s)CAN data transmission speed in kilo bits per second500
CAN PinsCAN pins for on-board Arduino Teensy CAN1 controllerDefault (Tx:22, Rx:23)
Filter configurationAcceptance filter filtering criteriaAllow all
Number of mailboxNumber of CAN mailboxes8
Mailbox typeType of CAN mailbox to either receive or transmit dataRx
ID typeCAN message ID typeStandard
IDCAN receiver filter value0x7FF
ID RangeMatrix of CAN receiver filter identifiers255
MaskCAN receiver mask value0
Enhance filterEnhanced filtering optionoff

Modbus properties

ParameterDescriptionDefault Value
Communication InterfaceType of communication interface that the block will use for Modbus® communicationRS485
ModeModbus mode of operationClient
Server IDServer device address or identifier1
Configure CoilsConfigure coil register parametersSelected
Configure Discrete InputsConfigure discrete input register parametersSelected
Configure Holding registersConfigure holding register parametersSelected
Configure Input registersConfigure input register parametersSelected
Received timeout (ms)Maximum time in milliseconds the client waits for a response from Modbus server100

RS485 properties

ParameterDescriptionDefault Value
Serial ModuleSerial module (port) that the block will use for Modbus communication Serial 1
BaudRateBaud rate of Modbus communication9600
ConfigurationDate frame configuration for Modbus communication blocksSERIAL_8N1
DE PinData Enable pin number8
RE PinReceive Enable pin number9

Display properties

ParameterDescriptionDefault Value
Enable code generation for Dashboard blocks

Select this option to enable code generation support for:

  • Dashboard Display block on the LCD and TFT display types and

  • Dashboard Gauge block on the TFT display type

Off
Configured display propertiesDisplays name of the present parameters configured in the Display Configuration Setup window for the LCD and TFT display types in the format <display type: configuration library file>.None
Launch Display Configuration SetupClick this button to launch the Display Configuration Setup window.Button

BLE properties

ParametersDescriptionDefault Values
Peripheral Device NameEnter device name of a BLE peripheralArduino
Peripheral Local NameEnter local name of a BLE peripheralArduino
Advertising Interval (*0.625 mS)Enter the BLE advertising interval during which the peripheral device sends advertising packets periodically on each advertising channel160
Min Connection Interval (*1.25 mS)Enter the lowest time required by the peripheral device to establish a BLE connection with the central device6
Max Connection Interval (*1.25 mS)Enter the highest time required by the peripheral device to establish a BLE connection with the central device3200

ESP32 board properties

ParametersDescriptionDefault Values
BoardSelect a variant of the ESP32 board series.ESP32-WROOM-DevKitV1(30 pin)
Prompt boot button press and release on ESP32 boardSelect this option to enable prompt boot button and release on ESP32 hardware board during flashing.Off
Create Custom boardClick this button to open a template file in editor to add a custom ESP32 Arduino board to support package.Button