Arduino Mega 2560 Pinout
Find the Arduino Mega 2560 pinout, digital and analog pins, memory limits, and Circuitera compile/upload support. Check board-specific library compatibility.
- Processor
- ATMEGA2560
- Clock
- 16 MHz
- Physical flash
- 262144 bytes
- Application flash
- 253952 bytes
- SRAM
- 8192 bytes
- EEPROM
- 4096 bytes
- Digital pins
- 54
- Analog inputs
- 16
- PWM
- D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D44, D45, D46
- Hardware UARTs
- 4
- UART pins
- D0, D1, D14, D15, D16, D17, D18, D19, RX0, TX0, RX1, TX1, RX2, TX2, RX3, TX3
- I2C
- D20, D21, SDA, SCL
- SPI
- D50, D51, D52, D53, MISO, MOSI, SCK, SS
- External interrupts
- D2, D3, D18, D19, D20, D21
- Logic voltage
- 5 V
- Bootloader
- STK500v2 · Wiring
- Protocol / baud
- STK500v2 · 115200
- Compile capability
- Verified · automated compile
- Upload capability
- Untested · physical hardware
- Serial capability
- Untested · physical hardware
- Simulation
- Not supported for this profile
- Build-matched compile check
- 2026-10-25
Compile for the larger AVR target
Select Arduino Mega 2560 before Verify. Its 16 MHz ATmega2560 target provides 253,952 bytes of application flash and 8,192 bytes of SRAM, with bootloader space already excluded from the application limit. Build Output uses these Mega limits. Servo, Wire, SPI, EEPROM, and the bundled library compile checks are available for this target; compilation is not a hardware test.
Wire to the Mega pin map
Mega exposes D0–D53 and A0–A15. PWM pins are D2–D13 and D44–D46. I2C uses D20 (SDA) and D21 (SCL); SPI uses D50 (MISO), D51 (MOSI), D52 (SCK), and D53 (SS), also available on the ICSP header. Do not copy Uno A4/A5 I2C wiring onto a Mega. Check the board-aware pin helper before connecting peripherals.
Choose the right serial interface
Serial connects to the board’s USB serial bridge through D0/D1. Serial1 uses RX19/TX18, Serial2 uses RX17/TX16, and Serial3 uses RX15/TX14 for external devices. These extra UARTs do not become separate browser USB ports. Serial Monitor still uses the selected USB connection; use your sketch to relay other UART data if needed.
Upload support and simulation limits
The Mega upload target uses the STK500v2/Wiring bootloader protocol at 115200 baud, with board-specific signature and flash verification. This release has compiler and protocol tests; physical Mega upload has not been verified in the development test environment. Mega 2560 simulation is not supported. Circuitera blocks running this target in the simulator rather than silently simulating an Uno.
Upload and validation limits
Select the actual board and bootloader, use a USB data cable, and grant one port permission. Keep serial pins clear of interfering peripherals.
No physical upload certification recorded in these build reports. Compile capability, simulated protocol tests and physical upload are separate claims.
Toolchain: avr-gcc-wasm@0.2.0. Last matching compile evidence: 2026-10-25. Build: e0f6d304cce4ae0a0989a9b1300cbc1a21a595e5e3e7f57ed0ab3468ecf7940b.
Arduino Mega 2560 pinout table
Every pin and alias is present in the initial HTML. Filter by signal capability, or select a pin for its existing reference details. Disconnect power before changing wiring.
90 pin entries
Select a pin to read its capabilities.
| Pin | Capabilities | Details |
|---|---|---|
| DIGITAL · UART | Digital input/output · RX0 · Serial · shared with USB | |
| DIGITAL · UART | Digital input/output · TX0 · Serial · shared with USB | |
| DIGITAL · PWM · INTERRUPT | Digital input/output · PWM with analogWrite() | |
| DIGITAL · PWM · INTERRUPT | Digital input/output · PWM with analogWrite() | |
| DIGITAL · PWM | Digital input/output · PWM with analogWrite() | |
| DIGITAL · PWM | Digital input/output · PWM with analogWrite() | |
| DIGITAL · PWM | Digital input/output · PWM with analogWrite() | |
| DIGITAL · PWM | Digital input/output · PWM with analogWrite() | |
| DIGITAL · PWM | Digital input/output · PWM with analogWrite() | |
| DIGITAL · PWM | Digital input/output · PWM with analogWrite() | |
| DIGITAL · PWM | Digital input/output · PWM with analogWrite() | |
| DIGITAL · PWM | Digital input/output · PWM with analogWrite() | |
| DIGITAL · PWM | Digital input/output · PWM with analogWrite() | |
| DIGITAL · PWM | Digital input/output · PWM with analogWrite() · LED_BUILTIN | |
| DIGITAL · UART | Digital input/output · TX3 · Serial3 | |
| DIGITAL · UART | Digital input/output · RX3 · Serial3 | |
| DIGITAL · UART | Digital input/output · TX2 · Serial2 | |
| DIGITAL · UART | Digital input/output · RX2 · Serial2 | |
| DIGITAL · UART · INTERRUPT | Digital input/output · TX1 · Serial1 | |
| DIGITAL · UART · INTERRUPT | Digital input/output · RX1 · Serial1 | |
| DIGITAL · I2C · INTERRUPT | Digital input/output · SDA | |
| DIGITAL · I2C · INTERRUPT | Digital input/output · SCL | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL · PWM | Digital input/output · PWM with analogWrite() | |
| DIGITAL · PWM | Digital input/output · PWM with analogWrite() | |
| DIGITAL · PWM | Digital input/output · PWM with analogWrite() | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL | Digital input/output | |
| DIGITAL · SPI | Digital input/output · MISO | |
| DIGITAL · SPI | Digital input/output · MOSI | |
| DIGITAL · SPI | Digital input/output · SCK | |
| DIGITAL · SPI | Digital input/output · SS | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 54. No PWM. A4/A5 are not I²C on Mega. | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 55. No PWM. A4/A5 are not I²C on Mega. | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 56. No PWM. A4/A5 are not I²C on Mega. | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 57. No PWM. A4/A5 are not I²C on Mega. | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 58. No PWM. A4/A5 are not I²C on Mega. | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 59. No PWM. A4/A5 are not I²C on Mega. | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 60. No PWM. A4/A5 are not I²C on Mega. | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 61. No PWM. A4/A5 are not I²C on Mega. | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 62. No PWM. A4/A5 are not I²C on Mega. | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 63. No PWM. A4/A5 are not I²C on Mega. | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 64. No PWM. A4/A5 are not I²C on Mega. | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 65. No PWM. A4/A5 are not I²C on Mega. | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 66. No PWM. A4/A5 are not I²C on Mega. | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 67. No PWM. A4/A5 are not I²C on Mega. | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 68. No PWM. A4/A5 are not I²C on Mega. | |
| ANALOG · DIGITAL | 10-bit analog input (0–1023). Also digital pin 69. No PWM. A4/A5 are not I²C on Mega. | |
| DIGITAL · I2C | SDA · same electrical terminal as D20. | |
| DIGITAL · I2C | SCL · same electrical terminal as D21. | |
| DIGITAL · SPI | MISO · same electrical terminal as D50. | |
| DIGITAL · SPI | MOSI · same electrical terminal as D51. | |
| DIGITAL · SPI | SCK · same electrical terminal as D52. | |
| DIGITAL · SPI | SS · same electrical terminal as D53. | |
| DIGITAL · UART | RX0 · same electrical terminal as D0. RX0 · Serial · shared with USB | |
| DIGITAL · UART | TX0 · same electrical terminal as D1. TX0 · Serial · shared with USB | |
| DIGITAL · UART | RX1 · same electrical terminal as D19. RX1 · Serial1 Separate TTL UART; not a separate browser USB serial port. | |
| DIGITAL · UART | TX1 · same electrical terminal as D18. TX1 · Serial1 Separate TTL UART; not a separate browser USB serial port. | |
| DIGITAL · UART | RX2 · same electrical terminal as D17. RX2 · Serial2 Separate TTL UART; not a separate browser USB serial port. | |
| DIGITAL · UART | TX2 · same electrical terminal as D16. TX2 · Serial2 Separate TTL UART; not a separate browser USB serial port. | |
| DIGITAL · UART | RX3 · same electrical terminal as D15. RX3 · Serial3 Separate TTL UART; not a separate browser USB serial port. | |
| DIGITAL · UART | TX3 · same electrical terminal as D14. TX3 · Serial3 Separate TTL UART; not a separate browser USB serial port. | |
| POWER | 5 V power rail; not a programmable I/O pin. | |
| POWER | 3.3 V regulated output, up to 50 mA; not a programmable I/O pin. | |
| GROUND | Common ground reference. | |
| POWER | External power input before the regulator. Use USB for first projects. | |
| RESET | Active-low microcontroller reset. | |
| REFERENCE | Analog reference input. Configure analogReference() appropriately before applying an external reference. |
Library compile results
Actual source/hash-matched results for this exact profile. A passed compile does not prove a real peripheral, motor or wiring works.
| Library | Pinned version | Result | Flash / static RAM | Test date |
|---|---|---|---|---|
| HID | 1.0 | UNSUPPORTED | Not recorded | 2026-10-25 |
| Keyboard | 1.0.7 | UNSUPPORTED | Not recorded | 2026-10-25 |
| Mouse | 1.0.1 | UNSUPPORTED | Not recorded | 2026-10-25 |
| Servo | 1.3.0 | PASS | 3578 / 161 bytes | 2026-10-25 |
| Wire | 1.0 | PASS | 5258 / 408 bytes | 2026-10-25 |
| SPI | 1.0 | PASS | 3460 / 192 bytes | 2026-10-25 |
| EEPROM | 2.0 | PASS | 2788 / 188 bytes | 2026-10-25 |
| SoftwareSerial | 1.0 | PASS | 4362 / 301 bytes | 2026-10-25 |
| LiquidCrystal | 1.0.7 | PASS | 2850 / 59 bytes | 2026-10-25 |
| DHT | 1.4.7 | PASS | 6362 / 219 bytes | 2026-10-25 |
| Adafruit Unified Sensor | 1.1.15 | PASS | 10146 / 302 bytes | 2026-10-25 |
| Adafruit GFX | 1.12.6 | PASS | 11808 / 533 bytes | 2026-10-25 |
| Adafruit SSD1306 | 2.5.17 | PASS | 14614 / 399 bytes | 2026-10-25 |
| Adafruit BusIO | 1.17.4 | PASS | 7914 / 438 bytes | 2026-10-25 |
| Adafruit NeoPixel | 1.15.5 | PASS | 3880 / 41 bytes | 2026-10-25 |
| NewPing | 1.9.7 | PASS | 3822 / 209 bytes | 2026-10-25 |
| IRremote | 4.7.1 | PASS | 13248 / 1075 bytes | 2026-10-25 |
| Keypad | 3.1.1 | PASS | 4682 / 327 bytes | 2026-10-25 |
| AccelStepper | 1.64 | PASS | 6864 / 119 bytes | 2026-10-25 |
| LiquidCrystal_I2C | 1.1.2 | PASS | 4648 / 275 bytes | 2026-10-25 |
Projects and next steps
The public tutorials are validated on Uno. Their concepts can help with this board, but wiring, pin maps, libraries and the exact profile must be reviewed and verified separately; they are not claimed as tested projects on this board.