Arduino MEGA 2560 Hardware Manual

The Arduino MEGA 2560 Hardware Manual is a reference and user guide for the Arduino MEGA 2560 hardware and firmware. It provides up-to-date hardware information for the Arduino MEGA 2560 revision 3 and earlier boards. The Arduino MEGA 2560 is an upgrade to the popular Arduino Uno board, providing more pins, serial ports and memory. Arduino is the easy to use open-source electronics platform used by hobbyists, makers, hackers, experimenters, educators and professionals.

This blog article provides a review of the contents of the Arduino MEGA 2560 Hardware Manual by Warwick A. Smith. Find out what the book is about and what is inside.

Arduino MEGA 2560 Hardware Manual Front Cover
Arduino MEGA 2560 Hardware Manual Front Cover

Get all the information that you need on the hardware and firmware found on Arduino MEGA 2560 boards in this handy reference and user guide. Ideal for the workbench or desktop. This manual covers the Arduino MEGA 2560 hardware and firmware, and is a companion volume to the Arduino Uno Hardware Manual, which covers the Arduino Uno hardware and firmware.

Arduino MEGA 2560 Manual vs. Arduino Uno Hardware Manual

The Arduino MEGA 2560 Hardware Manual is written for the Arduino MEGA 2560 single board computer. It is based on the layout of the Arduino Uno Hardware Manual. There are some similarities between the Arduino Uno and Arduino MEGA 2560. The Arduino MEGA 2560 Hardware Manual is extended with extra diagrams and illustrations that the Arduino Uno manual does not have. Readers who already own the Arduino Uno Hardware Manual will find the Arduino MEGA 2560 hardware manual worth owning. An extra chapter has been added to make owning both manuals value for money. The extra chapter explains compatibility of Arduino shields between different Arduino models. Find out why some shields only work with some Arduino models and not with others.

When it comes to the power supply circuit of both boards, they are nearly identical. This manual points out the subtle differences between the power supply circuits of the two boards. Similarities and differences between the MEGA 2560 and Uno are pointed out in various places, where applicable.

Also see the blog post on the Arduino Uno manual on this website.

Arduino MEGA 2560 Hardware Manual Features

The list below includes some of the features of the manual, as listed on the back cover of the book.

  • Contains all of the Arduino MEGA 2560 hardware information in one place
  • Covers Arduino / Genuino MEGA 2560 revision 3 and earlier boards
  • Easily find hardware technical specifications with explanations
  • Pin reference chapter with interfacing examples
  • Diagrams and illustrations for easy reference to pin functions and hardware connections
  • Learn to back up and restore firmware on the board, or load new firmware
  • Basic fault finding and repair procedures for Arduino MEGA 2560 boards
  • Power supply circuits simplified and explained
  • Mechanical dimensions split into five easy to reference diagrams
  • Contains circuit diagrams, parts list and board layout to easily locate components
  • A chapter on shield compatibility explains how shields work across different Arduino boards
Arduino MEGA 2560 Hardware Manual Back Cover
Arduino MEGA 2560 Hardware Manual Back Cover

Where to Buy the Arduino MEGA 2560 Hardware Manual

Find the Arduino MEGA 2560 Hardware Manual on amazon.com and amazon.co.uk. Look at other buying options for other countries.



Arduino MEGA 2560 REV3 boards are also available from amazon.com and amazon.co.uk.



Full disclosure: this website is an affiliate of amazon.com and amazon.co.uk. The above links are our affiliate links for these websites. We will earn a small commission if you purchase a product using the above links.

Arduino MEGA 2560 Hardware Manual Table of Contents

The table of contents for the manual is a complete list of all of the sections in the manual. Take a look at the table of contents to get an idea of what the book is about.

Arduino MEGA 2560 Hardware Manual Preview

A preview of the Arduino MEGA 2560 Hardware Manual includes the complete introduction chapter. The preview includes the first two pages of every chapter.

More About the Arduino MEGA 2560 Rev3

The Arduino MEGA 2560 is a single board computer that uses an ATmega2560 microcontroller as its main processor to run software loaded via the Arduino IDE or other programming environment. It extends the capabilities and number of pins of the smaller Arduino Uno. The Arduino MEGA 2560 has the following features:

  • 54 digital input/output pins
  • 15 of the digital I/O pins have PWM capabilities
  • 16 analog inputs
  • 4 hardware serial ports (UARTs)
  • 1 TWI port (I2C compatible port)
  • 1 SPI port
  • More program memory, SRAM and EEPROM than an Arduino Uno
  • USB port
  • Reset button
  • ICSP header
  • External power jack

Arduino MEGA 2560 Hardware Manual Book Structure

The basic structure of the Arduino MEGA 2560 manual or book is the same as the Arduino Uno Hardware manual, but it is fully updated for the Arduino MEGA 2560. Chapters are laid out as follows.

Introduction

The introduction provides motivation on why one should buy the manual. Contains differences between the Arduino Uno Hardware Manual and Arduino MEGA 2560 Manual. Target audience, prerequisites, hardware requirements, software requirements and what is covered in the book.

Arduino MEGA 2560 Overview

This chapter, together with chapter 2, are basically the “hardware user manual” part of the book for the Arduino MEGA 2560. It covers all of the basics of the Arduino MEGA 2560: a general overview of the Arduino MEGA 2560, its main parts, and how to extend its hardware.

Basics of firmware, the software that comes factory loaded on a new Arduino MEGA 2560 board, is explained. The chapter wraps up with board handling precautions, a brief history of the Arduino MEGA 2560 and the hardware revisions that it has been through, some information on first time use, and basic testing.

Hardware Technical Information

More detailed technical information on the Arduino MEGA 2560 hardware.

Pin Reference and Interfacing

A detailed look at pins, pin functions and alternate pin functions. It includes various hardware interfacing examples. How to use and test the extra hardware serial ports on the MEGA 2560.

Power Reference

An explanation of both USB and external power sources. Power supply circuits are simplified. This is done by breaking them up into six simplified sections. Different voltage regulators are discussed. There is a comparison between MEGA 2560 and Uno power circuits.

MEGA 2560 Firmware and Bootloader

Information on all of the firmware on Arduino MEGA 2560 boards. How to update firmware, back up firmware and reload firmware.

Circuit Diagram and Components

Enhanced circuit diagrams broken into three parts. Arduino MEGA 2560 parts list and part location on the board.

Fault Finding and Measurement

A chapter dedicated to fault finding on the Arduino MEGA 2560. It covers basic fault finding techniques. An explanation of removing a faulty microcontroller from an Arduino MEGA 2560, and replacing it with a new one. This is for advanced users who have the necessary soldering skills.

Mechanical Dimensions and Templates

Length width and mass of an Arduino MEGA 2560. Mounting hole spacing and size. Header positions on the board. Various other dimensions in easy to read diagrams.

Arduino Shield Compatibility

A new chapter on shield compatibility not found in the Arduino Uno Hardware Manual. It looks at what makes Arduino shields either compatible or incompatible with different Arduino models.

Four different Arduino models show shield compatibility problems and solutions. These are the MEGA 2560, Uno, Due and Zero. Practical examples of commercial shields are used.

Specifications Quick Reference

A table in this appendix contains a summary of the Arduino MEGA 2560 technical specifications. This table has references to the appropriate sections in this book that have more information on each parameter.

Arduino Uno Manual

Here is a new book for all Arduino enthusiasts – the Arduino Uno Hardware Manual. This Arduino Uno Manual is a reference and user guide for the Arduino Uno hardware and firmware.

Pictured below are two copies of the new manual fresh off the press, published in 2019.

Arduino Uno manual
The Arduino Uno Hardware Manual – a Handy Reference and User Guide

Arduino Uno Manual Hardware Reference

The Arduino Uno Hardware Manual is ideal as a workbench reference for any Arduino user. It provides interesting and vital information on wiring circuits to an Arduino Uno. Good engineering practice, which includes properly calculating current that can be drawn per pin, is included. Current limits per pin are not as simple as quoting a maximum current that can be drawn per pin. Groups of pins have certain current limits in addition to limits per pin in the group. This is well explained in the manual. Figures and illustrations throughout the book help in understanding various hardware concepts.

Arduino Uno Hardware Manual on the workbench
Arduino Uno Hardware Manual in use on the Workbench

The manual includes Arduino Uno pin mapping to the ATmega328P microcontroller and a pin reference that explains the function of each pin. Interfacing examples show the use of each type of pin. This includes SPI, TWI, UART and PWM pins.

Fault Finding, Repair and Firmware

Basic fault finding techniques in the manual show how to test an Arduino Uno to see if it is faulty or working. Repair procedures show how to replace the ATmega328P microcontroller should it be faulty. Firmware must be loaded to a new microcontroller on an Arduino Uno so that it will work with the Arduino IDE programming environment. Firmware restoration and testing procedures are explained.

Programming Headers and External Programmers

The manual shows how to program both the ATmega32P and ATmega16U2 microcontrollers using external programmers, and explains why and when you would want to do this.

Arduino Uno Parts List, Circuit Diagram and Part Location

A parts list can be found in the Arduino Uno Hardware Manual which includes the new parts added to the recently updated Arduino Uno R3, the Rev3e version. Easily located parts or components on the Arduino Uno using the component position diagram. Find the same part in the circuit diagram, which is broken up into three easy to understand parts.

Extending Hardware, Handling Precautions and Technical Information

Learn about various methods of extending the Arduino Uno hardware, and adding external memory. Handling precautions explain how to avoid damaging an Arduino Uno during use and storage. Technical information such as memory types and sizes, power supply information, operating frequency, meaning of the on-board indicator LEDs, and pins that are shared between functions and connectors can all be found in the Hardware Technical Information chapter.

More Details on the Arduino Uno Hardware Manual

Visit the Arduino Uno Hardware Manual page on the publisher’s website for more information on this excellent book. Here you can find:

PWM on an Oscilloscope

What PWM looks like on an oscilloscope. PWM is Pulse Width Modulation which can be used to change the brightness of an LED. This article and video shows PWM on an oscilloscope by using the Fade example sketch or program from the Arduino IDE. An LED and series resistor is connected to an Arduino Uno pin and the Arduino sketch continually adjusts the brightness of the LED by using PWM on the pin.

Video Showing PWM on an Oscilloscope

The following video shows PWM on an oscilloscope that is continually changing in order to change the brightness of the LED. Both the LED and Arduino Uno can be seen in the inset video. PicoScope is a PC based oscilloscope that connects to the USB port of a computer. Software running on the computer acts as the oscilloscope screen and control panel and can be seen in the video.

Hardware and Software for the PWM Demo

Find the Fade sketch in the Arduino IDE under File → Examples → 01.Basics → Fade from the top menu. The oscilloscope GND is connected to the Arduino GND. Pin 9 of the Arduino is used as the measurement point to measure the PWM waveform on the oscilloscope. The image below shows how the LED and series resistor are connected to the Arduino Uno. For more information, see the related Fade tutorial on the Arduino website.

Fade Arduino Example used to Show PWM on an Oscilloscope

Fade Arduino Example used to Show PWM on an Oscilloscope

How PWM Works

PWM changes the duty cycle of a square wave, which means that it changes the ratio of its on time to its off time. When the square wave is on, or at 5V, for longer than it is off, the LED will burn brighter. If the square wave is off, or at GND, for longer than it is on, the LED will burn dimmer.

Duty cycle of a PWM waveform is usually given as a percentage. If the duty cycle is 80%, then the on cycle of the square wave is on for 80% of the time and off for 20% of the time. A square wave with a 50% duty cycle has an equal on and off time.

 

Arduino Genuino Zero Atmel Studio Can Not Upgrade Firmware

Arduino Genuino Zero Atmel Studio can not upgrade firmware after trying to connect to target microcontroller using device programming dialog box or start without debugging icon. How to fix the firmware upgrade problem when the firmware won’t upgrade. A failed firmware upgrade prevents the use of the target board with Atmel Studio 7. The firmware appears to upgrade, but does not, as described below.

Genuino Zero Atmel Studio can’t Upgrade Firmware Problem

After opening the Programming Dialog box in Atmel Studio 7, or trying to program or debug the board, the Firmware Upgrade dialog box opens. After clicking the Upgrade button in the dialog box, the firmware appears to upgrade immediately. When trying to connect to the board again with Atmel Studio, the Firmware Upgrade dialog box appears again saying that the firmware needs upgrading. The dialog box appears as follows after the attempted upgrade that does not work. Here the Firmware Upgrade dialog box appears after the Apply button was clicked in the Device Programming dialog box.

Arduino Genuino Zero Atmel Studio Can Not Upgrade Firmware

Arduino Genuino Zero Atmel Studio Can Not Upgrade Firmware

This problem occurred on my Genuino Zero board, but I have read reports of it happening on Arduino M0 Pro boards and Atmel SAMD21 Xplained boards as well. The firmware that Atmel Studio is attempting to upgrade is the firmware in the embedded debugger (EDBG) chip found on Arduino Genuino Zero, Arduino M0 Pro and SAMD21 Xplained Pro boards.

Arduino Genuino Zero Atmel Studio Can Not Upgrade Firmware Solution

This solution simply stops stops Atmel Studio from automatically checking if the firmware needs upgrading. It does not actually upgrade the firmware on the EDBG chip.

The following steps describe how to bypass the firmware upgrade in Atmel Studio.

1. Open the Device Programming Dialog Box

Start Atmel Studio and then click the Device Programming icon as shown in the image below. The icon is found on the top toolbar. This opens the Device Programming dialog box.

Atmel Studio Device Programming Icon

Atmel Studio Device Programming Icon

2. Open the Device Programming Settings

In the Device Programming dialog box, select EDBG as the tool and SWD for the interface. In the Device field, select the target microcontroller on the board. For Arduino / Genuino Zero / M0 Pro boards this is ATSAMD21G18A. For the Atmel SAMD21 Xplained Pro, it is ATSAMD21J18A.

When clicking the Apply button in the Device Programming dialog box, the Firmware Upgrade dialog box appears and then fails to properly upgrade the firmware. Instead of clicking the Apply button, click the Settings icon at the right of the Device Programming dialog box as shown in the image below.

Device Programming Settings

Device Programming Settings

3. Disable the Check Firmware Setting

In the Options dialog box, find Tools near the bottom of the left pane and expand it. Click the Tool settings item to select it. In the right pane, double click True at the right of Check firmware to change it to False. These steps are shown in the image below.

Disable Check Firmware

Disable Check Firmware

Click the OK button to close the dialog box.

4. Test the Changes

Finally test the changes. Back in the Device Programming dialog box, with the correct tool, device and interface selected, click the Apply button. This time the Firmware Upgrade dialog box should not appear and it should be possible to program and debug the target microcontroller. Click the Read button next to Device Signature to make sure that the communications with the target microcontroller is working. These steps are shown in the image below.

Read Device Signature

Read Device Signature

Conclusion

After completing the above steps, I was able to program my Arduino Genuino Zero board using Atmel Studio. I first backed up the bootloader using the Device Programming dialog box and then loaded a C program that blinks the on-board LED. This proved that the EDBG interface could be used to read and write without upgrading the firmware.

Although this solution may not be ideal because the EDBG firmware is not updated to the latest version, it still solved the problem of having an endless firmware upgrade loop that fails to upgrade the firmware and then prevents use of the target board with Atmel Studio.

 

Wemos SAMD21 M0 Arduino M0 Compatible Board

An Arduino M0 compatible board called Wemos SAMD21 M0 is available from several online shops such as Banggood, AliExpress and Amazon, and also appears from several sellers on eBay. What appears to be the same board is also marketed as RobotDyn SAMD21M0. This blog post provides more information on the board.

An image of the Wemos SAMD21 M0 is shown below. As can be seen in the image, the Wemos logo appears on the board near the SAMD21G18A microcontroller chip. This board is not an exact copy or clone of the Arduino M0, but has a few differences such as the extra TXD and RXD pins found at the end of the board.

WeMos SAMD21 M0 Arduino M0 Compatible

WeMos SAMD21 M0 Arduino M0 Compatible

Wemos SAMD21 M0 Board Logo

Apparently this board is not actually made by the Wemos company, but the board is silk-screened with the Wemos logo. This has been mentioned on the Arduino forum in a few places. Here are a couple of examples:

Arduino forum message mentioning that the Wemos board does not appear on the official Wemos website.

An Arduino forum user mentions that Wemos does not admit the existence of this board.

Arduino M0 Compatible

The Wemos SAMD21 M0 board is compatible with the Arduino M0 which was originally from arduino.org when arduino.org and arduino.cc were having their fight. Now that the two companies have finished fighting and merged back together, the Arduino M0 board is listed on the arduino.cc website.

Circuit Diagram

I have not found a circuit diagram for the Wemos SAMD21 M0 after extensive searching. As the board is compatible with the Arduino M0, the Arduino M0 information page will be useful. A circuit diagram or schematic for the Arduino M0 can be found under the DOCUMENTATION tab on this page.

Wrong Information

On many of the sellers web pages for the Wemos SAMD21 M0, there is incorrect information about the board that describes it as an Arduino Zero or Arduino M0 Pro. The information also mentions that it has Atmel’s embedded debugger (EDBG) on the board – this is not true. Only the Genuino Zero and Arduino M0 Pro have the EDBG.

Older Boards

Some users of earlier boards complained about the power LED being too bright. There were also complaints about the board not working with the Arduino IDE. This has changed with the newer boards. I have not had these problems with boards ordered in 2018.

Hardware Differences

Although the Wemos SAMD21 M0 board is compatible with the Arduino M0, it is not a clone or exact copy of the Arduino M0, but rather a variant of it.

Two extra serial port pins can be seen at the end of the board. These pins are labeled TXD and RXD. The power supply looks different between the boards and some of the components such as LEDs are in slightly different locations on the boards.

Wemos SAMD21 M0 Quick Start Tutorial

A Wemos SAMD21 M0 quick start tutorial can be found on the Starting Electronics website. This tutorial shows how to install the programming tools to program the Arduino M0 and compatible boards in the Arduino IDE. It shows how to blink the on-board LED as a quick test to see that the board is working and then shows how to use the serial ports to communicate with the Arduino IDE Serial Monitor.

Go to the Wemos SAMD21 M0 tutorial →