image thumbnail

Embedded Coder Target for Arduino

version 1.7.0.1 (916 KB) by MathWorks Embedded Coder Team
Custom target for Arduino and other processors

24.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 (2021). 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!