Embedded Coder Target for Arduino

Custom target for Arduino and other processors
27.5K Downloads
Updated 21 Apr 2017

View License

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 (2024). 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
Created with R2013b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: Device Drivers

Inspired: Embedded Coder Arduino Servo Write Block

Communities

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.7.0.1

Updated license
Updated license
-fixed typo in 'summary'

1.7.0.0

- removed Due reference - target doesn't support Due yet.
- added acknowledgement to Device Driver File Exchange submission - as a means to add more peripheral blocks to any target, including this one.

1.6.0.0

Version 2.0
* complete update to Arduino Embedded Coder target (that can be used to create even other custom targets)
* updated to support more I/O and Arduino platforms
* many examples included

1.4.0.0

updated other requirements

1.2.0.0

Updated title and description

1.1.0.0

Version 1.2.
* Simplified workflow to specify Arduino boards (no need to set MCU and upload rate)
* Support for Arduino Uno & newer boards
* Miscellaneous bug and usability fixes

1.0.0.0