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. |
|
CPU Speed (MHz) | Microcontroller speed of Arduino® board | 600 |
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 | ||
Select upload method | Set the upload type for the Simulink model on your Arduino board. | USB |
Set OTA device name | Set the name for your Arduino board. | OTA_DeviceName |
Set OTA device password | Set the password for your Arduino board. | OTA_DevicePassword |
Target device | Select your Arduino board from the drop-down menu. | Specify IP address |
Target board IP address | Manually enter the IP address of your Arduino board. | 192.168.137.0 |
Device password | Authenticate password of your Arduino board. | Enter device password to upload |
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 |
Baud rate | Select the maximum speed for downloading a Simulink model executable on your Arduino board in bits per second. | 115200 |
Application Download Baudrate | Select the maximum speed for 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. | <empty> |
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 for 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 for 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 for downloading a PIL executable of a 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 baud rate | Set the baud rate of the serial port on the Arduino hardware. | 9600 |
Serial configuration | Set the data frame configuration for serial communication. | SERIAL_8N1 |
Serial Tx and Rx Pins | Transmitter and receiver Arduino pins for serial communication. | Select according to your target hardware |
I2C properties
Parameter | Description | Default Value |
---|---|---|
I2C Bus speed (Hz) | Set the rate of data communication between the peripherals connected by the I2C bus. | 100000 |
SDA Pin | Set the serial data pin number of the Arduino board for I2C communication. | Select according to your target hardware |
SCL Pin | Set the serial clock pin number of the Arduino board for I2C communication. | Select according to your target hardware |
SPI properties
Parameter | Description | Default Value |
---|---|---|
SPI Clock Out Frequency (KHz) | Select the rate at which the clock signal oscillates on the clock line during SPI communication. | Select according to your target hardware |
SPI Mode | Select an SPI mode for data transmission. | Mode 0 – Clock Polarity 0, Clock Phase
0 |
Bit Order | Select the data bit order for transmission. | MSB first |
SD Card SPI CS Pin | Enter the chip select (CS) pin number of the SD card when interfaced with the Arduino board for SPI communication. | Select according to your target hardware |
CAN SPI CS Pin | Enter the chip select (CS) pin that the CAN shield uses for SPI communication with the Arduino board. | Select according to your target hardware |
SDO Pin | Enter the serial data out (SDO) pin number of the Arduino board to which the SPI peripheral device is connected. | Select according to your target hardware |
SDI Pin | Enter the serial data in (SDI) pin number of the Arduino board to which the SPI peripheral device is connected. | Select according to your target hardware |
SCK Pin | Enter the serial clock pin number of the Arduino board to which the SPI peripheral device is connected. | Select according to your target hardware |
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 |