View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Simulink Support Package for Arduino Mega 2560 Hardware (R2012a)

3.3 | 7 ratings Rate this file 88 Downloads (last 30 days) File Size: 414 KB File ID: #35641 Version: 1.2
image thumbnail

Simulink Support Package for Arduino Mega 2560 Hardware (R2012a)



14 Mar 2012 (Updated )

Simulink block library for creating standalone applications for the Arduino® Mega 2560 platform

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information

Arduino ( is a low-cost open-source electronics prototyping platform based on flexible, easy-to-use hardware and software.
With R2012a, Simulink provides built-in support for prototyping, testing, and running models on Arduino Mega 2560. You can design algorithms in Simulink for control systems and robotics applications, and see them perform with hardware.
To install support for Arduino Mega 2560, type "targetinstaller" in the MATLAB Command Window.
In the Target Installer that opens, do one of the following:
• If you have not downloaded the support package, choose "Internet". Target Installer automatically downloads a support package and installs it.
• If you have already downloaded the support package, choose "Folder". Then specify the location of this support package. Target Installer installs this support package.

Simulink support for Arduino® Mega 2560 includes the following driver blocks:
• Digital Input and Output
• Analog Input and Output
• Serial Receive and Transmit
• Servo Read and Write

This FileExchange entry is for R2012a support.

For more details about the Simulink Arduino® support, see:

For additional Simulink built-in support for hardware, see

Required Products Simulink
MATLAB release MATLAB 7.14 (R2012a)
MATLAB Search Path
Other requirements Simulink Support for the Arduino Mega requires a Microsoft Windows platform.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (20)
02 Oct 2016 Amar Ismail

I'm trying to install this support package for Matlab R2012a but I keep getting the following error:

"Cannot download Error downloading URL. Your network connection may be down or your proxy settings improperly configured.."

I tried to check the download link "" but it appears to be down.

Please help me with this issue as it is very important for my FYP.

Thank you! :)

Comment only
27 Nov 2014 Stanislav Sedelnikov

11 Apr 2014 Dan Lluch

Dan Lluch (view profile)

@Marta - this particular entry is for 12a. but is for 13a and beyond. you can read more information here:

Comment only
11 Apr 2014 Marta

Marta (view profile)

Does this support package compatible for R2013b?

Comment only
02 Dec 2013 Dan Lluch

Dan Lluch (view profile)

@Phillip - Mac support for this arduino support from simulink was added in R2013b... you can use this entry to initiate installation, but you will need 13b for Mac support.

Comment only
01 Dec 2013 Phillip Glau

I'm using 2012a for Mac OS x on 10.8 and when I type
targetinstaller, it pulls up the Target Installer window, but then when I select Internet as the option, I get:

"Select a Target

does not contain a valid support package. Please specify a folder that contains a valid support package and try again."

If I download the submission into my downloads folder and use the 'Folder' option and point it to the folder 'rtt_arduinomega2560_r2012a_v1_0' it also complains and says it is not a valid package.


Comment only
29 Sep 2013 Ashwini Masekar

15 Jun 2013 addie irawan

Hi guys;

Did anyone knows how big Arduino Mega could support the downloaded simulink program? I hv a quite big simulink program with stateflows and s-function builder blocks. I'm currently want to switch and implementing my model to the hardware. What I understand, the Arduino Simulink block for Arduino Mega is a Target block type NOT like Arduino IO package previously created and suited for Arduino UNO. I also would to know if you guys have experiences on editing Arduino IO package for Arduino Mega used. The Arduino IO package seems saving a lot of memory since the concept is creating virtual port pins of Arduino in SIMULINK blocks NOT downloading the SIMULINK program blocks into the Arduino such as Target block for Arduino Mega version. Please correct me if I mistaken.

Thank you in advance.

08 May 2013 efrianto tanto

09 Aug 2012 Raja Rout

03 Aug 2012 pedro

pedro (view profile)

excelente aporte

Comment only
31 Jul 2012 Twols

Twols (view profile)

I'm trying to run the model in external mode on an Arduino Mega 2560 R3. After downloading the compiled model the connection to the target fails (the external mode check box is set): After pressing the Connect to Target Button Simulink crashes. I'm running the 2012b Matlab on a Win7-64bit machine.

12 Jul 2012 Jose Villamizar


02 Jul 2012 Jedediah Frey

Jedediah Frey (view profile)

What is the difference between this package and "Embedded Coder Support Package for Arduino" (

This just appears to have the 'streamlined' installation of targetinstaller.

Comment only
07 Jun 2012 Dan Lluch

Dan Lluch (view profile)

@Heilko and @Ravikanth - please note previous post about where to ask technical questions on this. That is the best option for getting answers quickly...

@Heilko - difficult to tell from only this info.. I suggest to post again on Ansers or contact Technical Support. My guess is you picked the 'folder' option, but that wasn't where you downloaded the File Exchange entry... or you unzipped it already... no need to download it from here first... just run targetinstaller and follow the 'internet' option.

@Ravikanth - We expect that all revs of the 2560 are supported. If you have any issues, please contact Technical Support.

Thanks for the interest and have fun using the new capability!

Comment only
07 Jun 2012 Ravikanth Ananthoju

Can anyone please help me whether matlab and simulink supports Arduino Mega 2560 R3.....because this is R3 board... so just to make sure whether it supports or not?


Comment only
07 Jun 2012 Heiko

Heiko (view profile)

.../arduinouno does not contain a valid support package.
Please specify a folder that contains a valid support package and try again.

What is wrong? Can you help me ?



Comment only
30 Mar 2012 MathWorks Simulink Team

General guidelines:
* Please use this FileExchange page to post general comments and ratings on the support package

* If you have questions about using this support package, post your question at (with tag "arduino", and product "simulink")

* If you have an enhancement request or wish to report a possible bug, contact MathWorks Technical Support at

Comment only
23 Mar 2012 Nils

Nils (view profile)

Also, does this release have support for access to more (or all) input/output capabilities of the mega board?

Comment only
23 Mar 2012 Nils

Nils (view profile)

And what is released separately in this case? What can be downloaded here isn't entirely compatible with r2011b, I take it...?

Comment only
22 Mar 2012 1.2

Updated zip file and title

28 Mar 2012 1.3

Updated zip file

16 Jul 2012 1.4

* Updated title and description to clarify that support is for Arduino Mega 2560 board

12 Sep 2012 1.5

Updated title and description to emphasize that this entry is for R2012a support

20 Sep 2013 1.6

updated thumbnail and description

06 Feb 2014 1.7

Update to v1.1 to enable autodownload on non-R3 Arduino Mega 2560 boards

26 Feb 2014 1.8

Update to fix broken link

25 Oct 2016 1.2

New Version: 1.2

Contact us