The Mega is a microcontroller board based on the ATmega2560.
The Mega is a microcontroller board based on the ATmega2560. It has 54 digital input/output pins (of which 14 can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports), the 16MHz crystal, the USB-B connection, the DC power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with an AC-to-DC adapter or battery to get started.
The Mega 2560 R3 also adds SDA and SCL pins next to the AREF, placed near the RESET pin. One is the IOREF that allow the shields to adapt to the voltage provided from the board. The other is a not connected and is reserved for future purposes. The Mega 2560 R3 works with all existing shields but can adapt to new shields which use these additional pins.
The Mega 2560 board can be programmed with the Arduino Software (IDE).
The Mega 2560 comes preprogrammed with a bootloader that allows you to upload new code to it without the use of an external hardware programmer.
You can also bypass the bootloader and program the microcontroller through the ICSP (In-Circuit Serial Programming) header using ISP or similar.
For USB-UART interface used the ATmega16U2.
The Mega 2560 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 NDD and vin pin headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may become unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.
The ATmega2560 has 256KB of flash memory for storing code (of which 8 KB is used for the bootloader), 8 KB of SRAM and 4 KB of EEPROM.
Each of the 54 digital pins on the Mega can be used as an input or output. They operate at 5 volts. Each pin can provide or receive 20 mA as recommended operating condition and has an internal pull-up resistor (disconnected by default) of 20-50 k ohm. A maximum of 40mA is the value that must not be exceeded to avoid permanent damage to the microcontroller.
In addition, some pins have specialized functions:
There are a couple of other pins on the board:
See also the mapping Mega 2560 PinOut diagram
The Mega 2560 board has a number of facilities for communicating with a computer, another board, or other microcontrollers. The ATmega2560 provides four hardware UARTs for TTL (5V) serial communication. An ATmega16U2 on the board channels one of these over USB and provides a virtual com port to software on the computer (Windows machines will need a .inf file, but OSX and Linux machines will recognize the board as a COM port automatically. The Arduino Software (IDE) includes a serial monitor which allows simple textual data to be sent to and from the board. The RX and TX LEDs on the board will flash when data is being transmitted via the ATmega16U2 chip and USB connection to the computer (but not for serial communication on pins 0 and 1).
|DC Current for 5V Out||1A|
|DC Current for 3.3V Out||180mA|
|DC Current for USB 5V||500mA (limitation)|
|Input Voltage (recommended)||7-12V|
|Input Voltage (limit)||6-20V|
|Digital I/O Pins||54 (of which 15 provide PWM output)|
|Analog Input Pins||16|
|DC Current per I/O Pin||20mA|
|Flash Memory||256KB of which 8KB used by bootloader|
|Length × Width||101.52mm × 53.3mm|
* Do note the higher the input voltage the lower the output current.