- Getting started - https://www.mathworks.com/help/simulink/supportpkg/arduino_ug/io-device-builder.html
- Interfacing DHT11 sensor with Arduino using IO Device Builder - https://www.mathworks.com/help/simulink/supportpkg/arduino_ref/dht11-relative-humidity-temperature-io-device-builder.html
- Interfacing ADXL343 sensor with Arduino - https://www.mathworks.com/help/simulink/supportpkg/arduino_ref/adxl343-read-acceleration-io-device-builder.html
Deploying simulink code on the arduino board using the ICSP header instead of USB
6 views (last 30 days)
Show older comments
Hello,
for my project I'm using an arduino Nano board which is supposed to communicate with a different arduino using the serial communication pins on port 0 via Bluetooth. Since serial port 0 is already connected through the USB port to my computer I can't use it for communication.
This is why I would need a different way to deploy code on the arduino such as the the ICSP header. I can use 'normal simulation mode' just fine but my project shouldn't rely on the computer later on. Using an arduino (Mega, Uno, etc.) with multiple serial communication ports is currently not an option as I don't have enough physical space to fit it.
Perhaps there is a whole different way to circumvent this problem?
Kind regards
0 Comments
Answers (1)
Aravind
on 25 Jun 2025
From your question, I understand that you want to upload and run code from MATLAB/Simulink to the Arduino Nano using UART, but you are encountering issues because the only UART port on the Arduino Nano—serial port 0—is already occupied by your Bluetooth module. You are wondering if it is possible to upload code through the ICSP header instead of UART via USB, so the serial port remains free for the Bluetooth module.
Unfortunately, uploading code via the ICSP header directly through MATLAB or Simulink is not supported. To address your issue, the best solution is to move the Bluetooth module to use different pins for UART instead of serial port 0. This can be done by using the Arduino “Software Serial” library, which allows you to configure any two pins on the Arduino Nano as UART pins.
However, the Software Serial library is not directly supported in MATLAB/Simulink. To use it, you would need to create a custom serial communication block that utilizes the “Software Serial” library. This can be achieved with the “IO Device Builder” app, which is part of the "Simulink Support Package for Arduino Hardware". The app lets you integrate custom or third-party C/C++ source files as a System object, which appears as a block in Simulink. Using this approach, you can create a custom block to communicate with your Bluetooth module through Software Serial on pins other than those used by Serial port 0.
For more details on the "IO Device Builder" app, you can refer to the following documentation: https://www.mathworks.com/help/simulink/arduino-io-device-builder.html.
Additionally, here are a few tutorials to help you get started with the "IO Device Builder" app:
I hope this resolves your issue.
0 Comments
See Also
Categories
Find more on Arduino Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!