Model Configuration Parameters for Simulink Support Package for Arduino Hardware
Hardware Implementation Pane Overview
In the Modeling tab of the Simulink® Editor, click Model Settings.
In the Configuration Parameter dialog box, click Hardware Implementation.
Set the Hardware board parameter to a value such as
Arduino Mega 2560
.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.
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 Implementation Options (Simulink Coder)
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
, orautosar.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
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | No impact |
Safety precaution | No impact |
See Also
Hardware Implementation Options (Simulink Coder)
Build Options
Parameter | Description | Default Value |
---|---|---|
Build action | Option to specify whether you want only build or build, load, and run actions during code generation. |
|
Disable parallel build | Option to compile the generated code and driver source codes in parallel order for faster build and deployment speed. | off |
Enable force rebuild of static library | Option to create Arduino® library files only when the Simulink model is compiled for the first time for faster build and deployment speed. | off |
Verbose output | Provide additional diagnostics on host machine COM ports detection and Simulink model deployment on Arduino board. | off |
Terminate Teensy Loader application post deployment | Close Teensy Loader application after deploying a Simulink model on your Arduino Teensy hardware board. | off |
Host-board connection
Parameter | Description | Default Value |
---|---|---|
Application download | ||
Set host COM port | Automatically detect, manually select, or manually specify the COM port of your host computer to communicate with the Arduino board. | Automatically |
Baudrate | Select the maximum speed of downloading a Simulink model executable on your Arduino board in bits per second. | 115200 |
Application Download Baudrate | Select the maximum speed of downloading a Simulink model executable on your Arduino board in bits per second. | 115200(Default-New Bootloader) |
Bootloader COM Port | Enter the new COM port of the bootloader. | |
Connected I/O communication | ||
Hardware Serial Port | Select the serial port of your Arduino board. | Serial 0 |
Set host COM port | Automatically detect, manually select, or manually specify the COM port of your host computer to communicate with the Arduino board. | Automatically |
Baudrate | Select 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 Port | Select the serial port of your Arduino board. | Serial 0 |
Set host COM port | Automatically detect, manually select, or manually specify the COM port of your host computer to communicate with the Arduino board. | Automatically |
Baudrate | Select the maximum speed of downloading a Simulink model executable on your Arduino board in bits per second. | 921600 |
PIL communication | ||
Hardware Serial Port | Select the serial port of your Arduino board. | Serial 0 |
Set host COM port | Automatically detect, manually select, or manually specify the COM port of your host computer to communicate with the Arduino board. | Automatically |
Baudrate | Select the maximum speed of downloading a PIL executable of the Simulink model on your Arduino board in bits per second. | 921600 |
Connected IO
Parameter | Description | Default Value |
---|---|---|
Connected IO mode | Select the Connected I/O mode. | auto |
Action on data loss for source blocks | Select the action required for data loss on source blocks. | warning |
Overrun detection
Parameter | Description | Default Value |
---|---|---|
Enable overrun detection | Option to enable overrun detection | Not selected |
Digital output to set on overrun | Digital hardware pin to notify an overrun | 13 |
Analog input channel properties
Parameter | Description | Default Value |
---|---|---|
Analog input reference voltage | Option to set the reference voltage used to measure inputs to the ANALOG IN pins. | Default |
Serial port properties
Parameter | Description | Default 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 Configuration | Data frame configuration for serial communication | SERIAL_8N1 |
Serial 0 TX pin | Transmitter pin number for serial port 0 | 1 |
Serial 0 RX pin | Receiver pin number for serial port 0 | 3 |
Serial 1 TX pin | Transmitter pin number for serial port 1 | 33 |
Serial 1 RX pin | Receiver pin number for serial port 1 | 32 |
Serial 2 TX pin | Transmitter pin number for serial port 2 | 17 |
Serial 2 RX pin | Receiver pin number for serial port 2 | 16 |
I2C properties
Parameter | Description | Default Value |
---|---|---|
I2C Bus speed (Hz) | Option to specify the rate of data communication between the peripherals connected by the I2C bus | 100000 |
I2C SDA pin | Serial data pin number of Arduino board for I2C communication | 21 |
I2C SCL pin | Serial clock pin number of Arduino board for I2C communication | 22 |
SPI properties
Parameter | Description | Default 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 pin | Chip Select (CS) pin that your CAN shield uses for SPI communication. | 3 |
SPI SDO pin | Serial data out (SDO) pin of Arduino board for SPI communication | 23 |
SPI SDI pin | Serial data in (SDI) pin of Arduino board for SPI communication | 19 |
SPI SCK pin | Serial clock pin of Arduino board for SPI communication | 18 |
SD Card SPI CS pin | Chip select (CS) pin of SD card for SPI communication | 5 |
Ethernet shield properties
Parameter | Description | Default 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
Parameter | Description | Default Value |
---|---|---|
WiFi hardware | Select 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 password | The WPA password of the network. | secretPassword |
Hardware Serial Port | Select the port on the Arduino board that is connected to ESP8266. | Serial 0 |
Username | Username of the WPA2 Enterprise credential. | username |
Password | Password of the WPA2 Enterprise credential. | password |
IP address assignment | Select a method to assign IP address to your Arduino hardware board. | DHCP |
DNS server address | Address for domain name system (DNS) server |
|
Gateway address | IP address of the default gateway |
|
Subnet mask | Subnet mask of the network |
|
ThingSpeak properties
Parameter | Description | Default Value |
---|---|---|
Connect to custom ThingSpeak server | The 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
Parameter | Description | Default Value |
---|---|---|
Broker service | MQTT broker service provider | ThingSpeak |
Broker address | MQTT broker web address | mqtt3.thingspeak.com |
Port | MQTT broker port number | 1883 |
Username | MQTT client username | <empty> |
Password | MQTT client password | <empty> |
Client ID | MQTT client identification number | <empty> |
Event system
Parameter | Description | Default Value |
---|---|---|
Enable EVSYS channel 0, 1, 2, 3 | Event channel to route events from the channel generator to the channel user | off |
Channel generator | Peripheral trigger that is the source of the event generator | TCC0 overflow |
Channel user | Peripheral user who utilizes the event generator trigger on the channel | ADC start conversion |
External mode
Parameter | Description | Default 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
|
|
Use a dedicated timer to improve time stamp accuracy | Enable the parameter to use a dedicated timer to improve the accuracy of the time stamps. | on |
Set logging buffer size automatically | Automatically set the number of bytes to preallocate for the buffer in the hardware during simulation. |
|
Logging buffer size (in bytes) | Specify the memory buffer size for XCP-based External mode simulation. | 2048 |
Verbose | The 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 time | Set XCP-based target polling time for Simulink models automatically or manually. | Automatically |
Polling time (in seconds) | Enter polling time in seconds. | 2 |
CAN properties
Parameter | Description | Default Value |
---|---|---|
CAN Bus Speed (kBit/s) | Bus speed in kilo bits per second. | 500 |
Oscillator Frequency (MHz) | Oscillator frequency in mega hertz. | 16 |
Interrupt Pin | Interrupt pin value to enable reading the message. | 12 |
Allow All Messages | Option to allow all messages. | Off |
Buffer 0 ID Type | Buffer 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 Type | Buffer 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
Parameter | Description | Default Value |
---|---|---|
CAN Bus Speed (kBits/s) | CAN data transmission speed in kilo bits per second | 500 |
CAN Pins | CAN pins for on-board Arduino Teensy CAN1 controller | Default (Tx:22, Rx:23) |
Filter configuration | Acceptance filter filtering criteria | Allow all |
Number of mailbox | Number of CAN mailboxes | 8 |
Mailbox type | Type of CAN mailbox to either receive or transmit data | Rx |
ID type | CAN message ID type | Standard |
ID | CAN receiver filter value | 0x7FF |
ID Range | Matrix of CAN receiver filter identifiers | 255 |
Mask | CAN receiver mask value | 0 |
Enhance filter | Enhanced filtering option | off |
Modbus properties
Parameter | Description | Default Value |
---|---|---|
Communication Interface | Type of communication interface that the block will use for Modbus® communication | RS485 |
Mode | Modbus mode of operation | Client |
Server ID | Server device address or identifier | 1 |
Configure Coils | Configure coil register parameters | Selected |
Configure Discrete Inputs | Configure discrete input register parameters | Selected |
Configure Holding registers | Configure holding register parameters | Selected |
Configure Input registers | Configure input register parameters | Selected |
Received timeout (ms) | Maximum time in milliseconds the client waits for a response from Modbus server | 100 |
RS485 properties
Parameter | Description | Default Value |
---|---|---|
Serial Module | Serial module (port) that the block will use for Modbus communication | Serial 1 |
BaudRate | Baud rate of Modbus communication | 9600 |
Configuration | Date frame configuration for Modbus communication blocks | SERIAL_8N1 |
DE Pin | Data Enable pin number | 8 |
RE Pin | Receive Enable pin number | 9 |
Display properties
Parameter | Description | Default Value |
---|---|---|
Enable code generation for Dashboard blocks | Select this option to enable code generation support for:
| Off |
Configured display properties | Displays 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 Setup | Click this button to launch the Display Configuration Setup window. | Button |
BLE properties
Parameters | Description | Default Values |
---|---|---|
Peripheral Device Name | Enter device name of a BLE peripheral | Arduino |
Peripheral Local Name | Enter local name of a BLE peripheral | Arduino |
Advertising Interval (*0.625 mS) | Enter the BLE advertising interval during which the peripheral device sends advertising packets periodically on each advertising channel | 160 |
Min Connection Interval (*1.25 mS) | Enter the lowest time required by the peripheral device to establish a BLE connection with the central device | 6 |
Max Connection Interval (*1.25 mS) | Enter the highest time required by the peripheral device to establish a BLE connection with the central device | 3200 |
ESP32 board properties
Parameters | Description | Default Values |
---|---|---|
Board | Select a variant of the ESP32 board series. | ESP32-WROOM-DevKitV1(30 pin) |
Prompt boot button press and release on ESP32 board | Select this option to enable prompt boot button and release on ESP32 hardware board during flashing. | Off |
Create Custom board | Click this button to open a template file in editor to add a custom ESP32 Arduino board to support package. | Button |