Arduino Mega 2560 is an extended version of the Arduino Uno built on the ATmega2560 microcontroller, has more contacts - 54 digital I / Os (14 of which can be used as PWM outputs), 16 analog inputs, more hardware serial ports - 4 serial UART ports, crystal oscillator 16 MHz, USB connector, power connector, ICSP connector and reset button.
To work with Mega 2560, you need to connect the platform to your computer using a USB cable or supply power using an AC / DC adapter or a rechargeable battery. Arduino Mega 2560 is compatible with all expansion boards designed for Arduino Uno or Duemilanove platforms.
The Arduino Mega 2560 Rev3 is the latest model to replace the previous Arduino Mega 2560 and Mega 1280. The Rev3 version includes an Atmega16U2 chip (Atmega8U2 in Rev1 and Rev2 versions) with a USB to Serial converter firmware instead of those used in more early versions of FTDI chips. The ATmega16u2 microcontroller allows the Arduino Mega2560 controller to be used as a USB HID device. By flashing this microcontroller, the controller can be used as a keyboard, mouse or game joystick.
- 1 Arduino Mega 2560 Specifications
- 2 Arduino Mega 2560 CH340G
- 3 Description of the elements of the Arduino Mega 2560 board
- 4 I / O ports
- 5 Description of pins Arduino Mega 2560
- 6 Power supply for Arduino Mega 2560
- 7 Installing drivers
- 8 Board and port selection
- 9 Materials
- 10 Buy Arduino Mega 2560 on AliExpress
- 11 Similar entries
Arduino Mega 2560 Specifications
Microcontroller | ATmega2560 |
Working voltage | 5B |
Supply voltage (recommended) | 7-12V |
Supply voltage (limit) | 6-20V |
Digital I / O | 54 (14 of which can function as PWM outputs) |
Analog inputs | sixteen |
PWM pins | 14 |
Constant current through input / output | 40 mA |
Maximum output current of output 3.3V | 50 mA |
Flash memory | 256 KB (of which 8 KB are used for bootloader) |
SRAM / RAM | 8 KB |
EEPROM | 4 KB |
Clock frequency | 16 MHz |
Built-in LED | thirteen |
Length | 101.6 mm |
Width | 53.4 mm |
Weight | 25 g |
Schematic diagram
Arduino Mega 2560 CH340G
This board has all the features of the classic Arduino Mega 2560 Rev3 board. The main differences from the original are due to the fact that a USB bridge is used to reduce the cost of the board, it is made on a budget CH340G microcircuit . All elements of external connections, including the names of ports, on this board fully correspond to the schematic diagram of the original board. For the CH340G USB bridge chip, you need to install drivers on your computer, which can be downloaded here .
Schematic diagram
Description of the elements of the Arduino Mega 2560 board
- ATmega2560 Microcontroller - The heart of the Arduino Mega 2560 platform is the 8-bit AVR microcontroller, the ATmega2560. It provides 256KB of flash memory for storing firmware, 8KB of SRAM and 4KB of non-volatile EEPROM for data storage.
- Microcontroller ATmega16U2 - The ATmega16U2 microcontroller provides communication between the ATmega2560 microcontroller and the USB port of the computer. When connected to a PC, the Arduino Mega 2560 is defined as a virtual COM port. The 16U2 firmware uses standard USB-COM drivers - no external drivers are required.
- I / O ports
- LED indication
- RX and TX - Flashes when communicating between the Arduino Mega 2560 and the PC.
- L - Output LED 13. When set to HIGH, the LED turns on, when set to LOW, it turns off.
- ON - Availability of power to the Arduino Mega 2560.
- USB Type-B connector - The USB Type-B connector is designed to flash the Arduino Mega 2560 platform using a computer.
- Connector for external power supply - Connector for connecting an external power supply from 7 V to 12 V.
- ICSP Connector for ATmega2560 - The ICSP connector is for in-circuit programming of the ATmega2560 microcontroller. Also, using the SPI library, these pins can communicate with expansion boards via the SPI interface. SPI lines are brought out to a 6-pin connector, and are also duplicated on digital pins 50 (MISO), 51 (MOSI), 52 (SCK) and 53 (SS).
- ICSP Connector for ATmega16U2 - ICSP connector for in-circuit programming of the ATmega16U2 microcontroller.
I / O ports
- Digital inputs / outputs : pins 0-53
Logic level of one - 5 V, zero - 0 V. Maximum output current - 40 mA. Pull-up resistors are connected to the contacts, which are disabled by default, but can be enabled by software. - PWM : pins 2-13 and 44-46
Allow 8-bit analog values to be output as a PWM signal. - ADC : pins A0 – A16
16 analog inputs, each of which can represent analog voltage as a 10-bit number (1024 values). The ADC capacity is 10 bits. - TWI / I²C : pins 20 ( SDA ) and 21 ( SCL )
For communication with peripherals using a synchronous protocol, via 2 wires. Use the Wire library to work. - SPI : pins 50 ( MISO ), 51 ( MOSI ), 52 ( SCK ) and 53 ( SS ).
SPI commutation pins (use the SPI library). - UART :
- Serial : pins 0 (RX) and 1 (TX);
- Serial1 : pins 19 (RX) and 18 (TX);
- Serial2 : pins 17 (RX) and 16 (TX);
- Serial3 : pins 15 (RX) and 14 (TX).
These pins are used to receive (RX) and transmit (TX) data over the serial interface. Pins 0 (RX) and 1 (TX) are connected to the corresponding pins of the ATmega16U2, which acts as a USB-UART converter.
Arduino Mega 2560 pin description
Mega board digital pins
Pins numbered 0 through 53 are numeric. This means that you can only read and apply two kinds of signals to them: HIGH and LOW. With PWM, you can also use digital ports to control the power of connected devices.
Pin | Addressing | Special appointment | PWM |
---|---|---|---|
0 | 0 | RX (Serial) | |
one | one | TX (Serial) | |
2 | 2 | Interrupt input 0 | PWM |
3 | 3 | Interrupt input 1 | PWM |
4 | 4 | PWM | |
5 | 5 | PWM | |
6 | 6 | PWM | |
7 | 7 | PWM | |
eight | eight | PWM | |
9 | 9 | PWM | |
10 | 10 | PWM | |
eleven | eleven | PWM | |
12 | 12 | PWM | |
thirteen | thirteen | Built-in LED | PWM |
14 | 14 | TX (Serial3) | |
15 | 15 | RX (Serial3) | |
sixteen | sixteen | TX (Serial2) | |
17 | 17 | RX (Serial2) | |
eighteen | eighteen | TX (Serial1) Input for interrupt 5 | |
nineteen | nineteen | RX (Serial1) Interrupt input 4 | |
twenty | twenty | I2C SDA Interrupt input 3 | |
21 | 21 | I2C SCL Interrupt input 2 | |
22-43 | 22-43 | ||
44 | 44 | PWM | |
45 | 45 | PWM | |
46 | 46 | PWM | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | ||
50 | 50 | MISO | |
51 | 51 | MOSI | |
52 | 52 | SCK | |
53 | 53 | SCL |
Analog pins of the board
The Mega2560 platform has 16 analog inputs, each with a resolution of 10 bits (i.e., it can accept 1024 different values). As standard, the pins have a measuring range of up to 5 V with respect to ground, however it is possible to change the upper limit by means of the AREF pin and function analogReference()
.
Pin | Addressing | Special appointment |
---|---|---|
A0 | A0 or 54 | |
A1 | A1 or 55 | |
A2 | A2 or 56 | |
A3 | A3 or 57 | |
A4 | A4 or 58 | TCK |
A5 | A5 or 59 | TMS |
A6 | A6 or 60 | TDO |
A7 | A7 or 61 | TDI |
A8 | A8 or 62 | PCINT16 |
A9 | A9 or 63 | PCINT17 |
A10 | A10 or 64 | PCINT18 |
A11 | A11 or 65 | PCINT19 |
A12 | A12 or 66 | PCINT20 |
A13 | A13 or 67 | PCINT21 |
A14 | A14 or 68 | PCINT22 |
A15 | A15 or 69 | PCINT23 |
Additional pins on the board
- AREF - Voltage reference for analog inputs. Used with a function
analogReference()
. - Reset - A low signal level at the pin reboots the microcontroller. Usually used to connect a reset button on an expansion board, which prevents access to the button on the Arduino board itself.
Power pins
- Vin : Input voltage of the Arduino board when using an external source (unless there is a 5 volt voltage on the USB connection or from another power source). You can supply power to this pin, or, if power is supplied to the 2.1 mm connector, you can get from this pin to the supply input voltage.
- 5V : The voltage on these pins is regulated by the on-board voltage regulator. The board can be powered either through the 2.1mm power connector (7-12V), via the USB connection (5V), or via the VIN pin (7-12V) on the board. Powering the 5V or 3.3V pins bypasses the regulator and could damage the board. This is not recommended.
- 3.3V : 3.3V is generated by the on-board regulator. The maximum current consumption should not exceed 50 mA.
- GND : Ground pins.
- IOREF : This pin provides the reference voltage with which the microcontroller operates. For the correct configuration of external boards, you can read the voltage from this pin and select the appropriate power source or turn on voltage converters to work with 5 V or 3.3 V.
Arduino Mega 2560 Power
The Arduino Mega can be powered from a USB port or external source. The power supply is automatically selected.
External power (not USB) can be supplied from the AC adapter or battery. The power supply is connected to the 2.1 mm connector on the board, which has a central positive terminal. Battery power can be connected to the GND and VIN pins of the POWER connector.
The board can operate from an external voltage source in the range from 6 to 20 volts. If the power supply voltage is less than 7V, the 5V output may be less than 5V and the board may become unstable. If the voltage of the external source exceeds 12 V, the voltage regulator may overheat and damage the board. The recommended supply voltage range is 7-12 volts.
Installing drivers
If you've used the installer, Windows - XP to 10 - will automatically install the drivers as soon as you plug in your board. If you downloaded and unpacked the Zip archive, or for some reason the board is not recognized correctly, follow the procedure below.
- Click on the start menu and open the control panel.
- Go to the System and Security section . Then click on "System". Then open the Device manager.
- Look under Ports (COM & LPT) (Ports (COM & LPT)). You should see an open port named " USB Serial Device ". If the COM and LPT section is missing, see the Other Devices, Unknown Device section.
- Right click on the USB Serial Device port and select the " Update Drivers ... " option .
- Then select the option " Search for drivers on this computer ".
- Finally, find a driver file named “ arduino.inf ” located in the “ Drivers ” folder of the Arduino program (not the “FTDI USB Drivers” subdirectory).
- Windows will then complete the driver installation.
Board and port selection
Open Arduino IDE. From the Tools> Board menu, select Arduino / Genuino Mega or Mega 2560 . Select the processor / microcontroller of the board, usually ATmega2560. Select ATmega2560 (Mega 2560) from the Tools> Processor menu . Select the board's serial device from the Tools> Port menu . Most likely it is COM3 (Arduino / Genuino Mega or Mega 2560) or higher (COM1 and COM2 are usually reserved). To find out, you can turn off your board and reopen the menu; the entry that disappears must be Arduino or Genuino Mega. Connect the board and select this serial port.
If you have an Arduino Mega 2560 CH340G model, then it is better to use the Arduino as ISP programmer . It is possible not to use a bootloader and program the microcontroller via ICSP pins (in-circuit programming).
Social Plugin