Embedded Coder Target for Arduino
Editor's Note: This file was selected as MATLAB Central Pick of the Week
This file exchange submission is an Embedded Coder custom target for Arduino. It uses the Arduino platform as the example hardware, yet the examples it shows can be used to learn and then be applied on any custom target. In an applied way - it shows capabilities and steps that leverage many features of Embedded Coder and creating custom targets. Arduino has been selected since it is widely accessible, has a large DIY community, and is a great platform to explore the varying things that a custom target would need as the various Arduino platforms change.
A custom target author can use this submission to extend/create more Arduino targets, or to simply use this as an example to create your own. An end user that has Embedded Coder can use this submission for their Arduinos.
Some highlights included in this custom target include:
- Shows how to handle dependencies for different Arduino boards (and even non-Arduino boards). Current set includes Uno, Leonardo, Mega2560.
- Options available to drive to minimal footprint and memory
- Processor in the Loop (PIL)
- Numerous scheduling and timing modes explored.
- Overrun detection exposed in the Simulink algorithm directly to allow for algorithmic adjustments when overrun is detected during execution.
- A wealth of examples on how to add/change peripherals blocks/capabilities (LCD, Servo Motor, UART, printf into UART, DIO, Ultrasonic sensor, Async interrupt, I²C Master, I²C Slave, etc, etc).
Additional resources for creating custom targets
- Embedded Coder Product Documentation
www.mathworks.com/help/ecoder/index.html (account/license required)
- Developing Embedded Targets Advisory Service
www.mathworks.com/services/consulting/proven-solutions/developing-embedded-targets.html
- MATLAB Answers: example of developing a custom target
www.mathworks.com/matlabcentral/answers/93884
Note: Only Arduino IDE version 1.0.5 is supported and this submission is not maintained to support new IDEs.
For additional Arduino support, see www.mathworks.com/hardware-support/arduino-simulink.html.
Cite As
MathWorks Embedded Coder Team (2023). Embedded Coder Target for Arduino (https://www.mathworks.com/matlabcentral/fileexchange/30277-embedded-coder-target-for-arduino), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Test and Measurement > Data Acquisition Toolbox > Counter and Timer Input and Output >
- Code Generation > Embedded Coder > Deployment, Integration, and Supported Hardware > Embedded Coder Supported Hardware >
Tags
Communities
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
arduino_ec/
arduino_ec/+arduino_ec/
blocks/
blocks/
demos/
Version | Published | Release Notes | |
---|---|---|---|
1.7.0.1 | Updated license
|
||
1.7.0.0 | - removed Due reference - target doesn't support Due yet.
|
||
1.6.0.0 | Version 2.0
|
||
1.4.0.0 | updated other requirements |
||
1.2.0.0 | Updated title and description |
||
1.1.0.0 | Version 1.2.
|
||
1.0.0.0 |