AZ-Delivery Mega 2560 R3 Overview
AZ-Delivery Mega 2560 R3 Overview
Have fun!
Presentation
Difference between a microcontroller ATmega328P, ATmega16U2 and the Mega 2560 R3 board...
Specifications5
Broaching
Analog interface
I2C Interface..................................................................................................................................13
SPI Interface.................................................................................................................................13
Embedded LED............................................................................................................................13
Driver installation..................................................................................................................14
Code examples........................................................................................................................20
2
Introduction
The Mega 2560 R3 microcontroller board is the successor to the Mega board.
This is a microcontroller board based on a microcontroller.
ATmega2560 AVR. It has 54 digital input/output pins.
(14 can be used as PWM outputs), 16 inputs
analog, 4 UART (hardware serial ports), a quartz oscillator of
16MHz, a USB connection, a power socket, an ICSP connector
and a reset button.
The Mega 2560 R3 with ATmega2560 adds SDA and SCL pins to
next to the AREF. In addition, there are two new pins placed near the
RESET brooch.
The AZ-Delivery Mega 2560 differs from the previous Mega in that it does not use
not the FTDI USB-to-serial driver chip. Instead, it has a chip
CH340 as USB-to-serial converter. This chip allows the
communication between the PC and the Mega and downloading the code to the
ATmega2560 processor.
To enable communication between the PC and the Mega, a driver for the
the CH340 chip must be installed.
3
Difference between an ATmega328P microcontroller, ATmega16U2 and the
Mega 2560 R3 board
4
Specifications
Microcontroller ATmega2560
DC power supply 7-12V
Power supply voltage limit 6-20V
USB Tension 5V
Digital I/O connectors 54 (14 with PWM support)
Analog input connectors 16
DC consumption by I/O 40mA
DC consumption by 3.3V 50mA
Flash Memory 256KB (8KB for the bootloader)
SRAM 8KB
EEPROM 4KB
Clock frequency 16MHz
Interfaces SPI, I2C, UART
Dimensions 102x53x15mm (4.1x2x0.6in)
5
Broaching
6
MEGA 2560 R3
The Mega 2560 R3 can be powered in three ways: via the USB cable for
power the board and download the code, via the pin on the board or
through the power supply or the battery.
The Mega 2560 R3 comes with a resettable polyfuse that prevents the
USB port of your computer to overheat in the presence of a high current
circulating on the map. Most computers are equipped with a capacity
to protect oneself from such devices, but adding a fuse offers a layer
of additional protection.
7
Compatibility of the Mega 2560 R3 shield
The main UART (serial port) is located on the same pins (0 and 1), all
like external interrupts 0 and 1 (pins 2 and 3 respectively).
The SPI is available via the ICSP header on Mega 2560 R3 boards.
and ATmega328P, ATmega16U2.
8
Description of the pins
9
Serial communication interface
The RXD and TXD serial pins are used for transmitting and receiving.
data series. The Rx represents data transmission while
that the Tx is used to receive data.
10
External interrupt interface
AREF
11
Analog interface
There are 16 analog pins built into the board, labeled from A0 to
A15. It is important to note that all these analog pins can
to be used as digital I/O pins. Each pin
analog with a resolution of 10 bits. They can measure a voltage.
from 0 to 5V. However, the upper value can be modified by using the
AREF function and analogReference() from the Arduino IDE.
12
I2C Interface
SPI Interface
SPI stands for Serial Peripheral Interface and is used for transmission of
data between the controller and other peripheral components. Four
pins 50(MISO), 51(MOSI), 52(SCK), 53(SS) are used for the
communication SPI.
Embedded LED
13
Driver installation
To use the Mega 2560 R3 with the Arduino IDE on Windows, the driver
USB must be installed. The driver can be downloaded from thislink.
Extract the downloaded file and open the folder where the file is.
It has been extracted. Run the installation file called [Link].
14
Once the installation is complete, open the device manager of
Windows and check if the driver is present. The Mega must be connected to
PC via a USB cable. If the driver is correctly installed, it will display
as shown in the following image:
15
Configure the Arduino IDE
If the Arduino IDE is not installed, follow thelinkand download the file
installation for the OS of your choice. The version of the Arduino IDE used
in this eBook is the 1.8.13.
For Windows users, launch the .exe file and follow the instructions.
instructions.
16
For Linux users, download a file named
the .[Link] extension, which needs to be extracted. When it is extracted, go to the
directory extracted and open the terminal in this directory. Two .sh scripts
must be executed, the first called [Link] and the second
called [Link].
To run the first script in the terminal, open the terminal in the
extract the directory and execute the following command:
sh [Link] user_name
user_name - is the name of a superuser in the operating system
Linux. A password for the superuser must be entered at the time of
launch of the order. Please wait a few minutes for the script to
finish.
The second script, called [Link], must be used after the installation of
first script. Run the following command in the terminal (directory
extract) :sh [Link]
After installing these scripts, go to the folder where the IDE is installed.
Arduino.
17
Almost all operating systems come with a text editor.
pre-installed (for example, Windows comes with Notepad, Linux Ubuntu with
Gedit, Linux Raspbian with Leafpad, etc.) All these text editors
perfectly suited to the purpose of this eBook.
18
Code example
Blinking LED
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
voidloop() {
digitalWrite(LED_BUILTIN,HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
}
20
PWM - Pulse Width Modulation
void setup() {
pinMode(led, OUTPUT);
}
voidloop() {
analogWrite(led, brightness);
brightness = brightness + fadeAmount;
if(brightness <= 0 || brightness >= 255) {
-fadeAmount;
}
delay(30);
}
21
It is now time to learn and develop your own projects.
You can do it using many examples of scripts and others.
tutorials that you can find on the Internet.
[Link]
Have fun!
Legal Notices
Unable to access external URLs or content.
22