Start with Arduino MEGA ADK

Getting started with the Arduino MEGA ADK

This guide shows you how to use your Arduino Mega ADK and to upload a sketch.

First you must connect your Arduino board to your computer, you need a USB cable (A plug to B plug). The USB cable will provide power and allow you to program the board. Attack the B plug of the USB cable to the Arduino Mega and the A plug to the PC. Now the green power LED (labelled ON) should turn on.

To upload a sketch, you must use Arduino IDE.Choose the correct version for your operating system, download and install it.

Open your Arduino IDE, choose Arduino Mega ADK from the Tools > Board menu in the IDE, and select the correct serial port from the Tools > Serial Port menu. Now choose an example from File > Examples menu and upload it, clicking the relative button.

Differences from ATMEGA based boards

The Arduino Mega ADK is a microcontroller board based on the ATmega2560 (datasheet). It has a USB host interface to connect with Android based phones, based on the MAX3421e IC. It has 54 digital input/output pins (of which 15 can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. The MEGA ADK is based on the Arduino Mega 2560. In general, you can program and use the Mega as you would do with other Arduino boards.

Voltage

The Arduino MEGA ADK can be powered via the USB connection or with an external power supply. The power source is selected automatically.

External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in the Gnd and Vin pin headers of the POWER connector.

Note: Because the MEGA ADK is a USB Host, the phone will attempt to draw power from it when it needs to charge. When the ADK is powered over USB, 500mA total is available for the phone and board.The external power regulator can supply up to 1500mA. 750mA is available for the phone and MEGA ADK board. An additional 750mA is allocated for any actuators and sensors attached to the board. A power supply must be capable of providing 1.5A to use this much current.

The board can operate on an external supply of 5.5 to 16 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may be unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.

Warning: The Arduino MEGA ADK has a resettable polyfuse that protects your computer's USB ports from shorts and overcurrent. Although most computers provide their own internal protection, the fuse provides an extra layer of protection. If more than 500 mA is applied to the USB port, the fuse will automatically break the connection until the short or overload is removed.

Installing Drivers for the Arduino MEGA ADK

OSX

The first time you plug a MEGA ADK into a Mac, the "Keyboard Setup Assistant" will launch. There's nothing to configure with the MEGA ADK, so you can close this dialogue by clicking the red button in the top left of the window.

Windows

If you previously installed Arduino IDE, you already have drivers installed.

If you haven't yet installed Arduino IDE, download the Windows version of the Arduino software from the official page here. When the download finishes, launch the file to install the software and the drivers.

If you downloaded the .zip version of the IDE, unzip the downloaded file. Make sure to preserve the folder structure. Now your drivers will be downloaded and installed from Internet, directly from Windows. If you have issues, you can find the "drivers" folder inside the unzipped file, for manual installation.

Linux

There is no need to install drivers for Ubuntu 10.0.4

In some computers, you need to setup user permissions and some udev rules. You can find detailed informations on how to achieve this at this page.

Uploading Code to the MEGA ADK

The uploading process on the Arduino Mega ADK works the same as other boards from a user's standpoint. Here are shown the steps used to upload a sketch:

Connect your board to the computer by attaching the USB cable to the USB port.

Open the Arduino IDE.

In the "Tools" menu choose "Serial Port" and select the serial port of the Mega ADK.