Arduino Due

The first 32-bit ARM Arduino. The Arduino Due puts a SAM3X8E Cortex-M3 at 84 MHz on the Mega's board shape, and adds real DAC outputs, a 12-bit ADC, CAN and a native USB port. This guide covers the board anatomy, a complete pinout with every pin and port, the all-important 3.3 V logic rule, power, both USB ports and every bus, and finishes with code examples and mini-projects.

Complete Learning Path — Arduino Due

From board anatomy and the SAM3X8E, to a full pinout with every pin detailed, 3.3 V logic, power, the two USB ports, PWM, ADC, DAC, UART/SPI/I2C/CAN, uploading, code examples and mini-projects

What is the Arduino Due?

The Arduino Due is the first Arduino with a 32-bit ARM processor. It uses the SAM3X8E ARM Cortex-M3 at 84 MHz, more than five times the clock of the 8-bit Mega 2560, on exactly the same 101.5 × 53.3 mm board shape.

You still write ordinary Arduino sketches with setup() and loop(), but you get far more speed and memory, plus hardware no AVR Arduino has: two true analog outputs (DAC), a 12-bit ADC, two CAN controllers and a native USB port. The one big change is that the whole board runs at 3.3 V, not 5 V.

Labelled Arduino Due board anatomy diagram: SAM3X8E ARM Cortex-M3, Native and Programming micro-USB ports, ATmega16U2, DC jack, 5 V and 3.3 V regulators, ERASE and RESET buttons, JTAG, SPI header and the 22-53 digital block — Power4All
A map of the Due: the SAM3X8E runs your code; note the two micro-USB ports, the ERASE button, the centre SPI and JTAG headers, and the DAC/CAN pins at the end of the analog header.
84 MHz
32-bit ARM Cortex-M3
54 + 12
Digital + analog pins
2 DAC
True analog outputs
512 KB
Flash (96 KB SRAM)
3.3 V
Logic level — not 5 V!

The Brain: SAM3X8E ARM Cortex-M3

The SAM3X8E (originally Atmel, now Microchip) is a 32-bit ARM Cortex-M3. Compared with the Uno's ATmega328P it runs 5× faster, handles 32-bit numbers in one instruction, and has 16× the flash and 48× the RAM.

SAM3X8E block diagram for the Arduino Due: Cortex-M3 CPU, 512 KB flash, 96 KB SRAM, SAM-BA boot ROM, 84 MHz PLL clock, DMA, GPIO, 12-bit ADC, 12-bit DAC, PWM, timers, UART, SPI, I2C, CAN and USB OTG — Power4All
Inside the SAM3X8E: a Cortex-M3 core fed by 512 KB flash and 96 KB SRAM, a 12 MHz crystal multiplied to 84 MHz, DMA, and a big set of peripherals.
  • Flash (512 KB, two 256 KB banks) — all of it is yours; the bootloader lives in a separate ROM.
  • SRAM (96 KB, 64 KB + 32 KB) — room for large arrays, audio buffers and display frame data.
  • SAM-BA boot ROM — a bootloader burned into the chip, so it can never be erased by accident.
  • No EEPROM — unlike AVR boards; save settings to an SD card, external EEPROM or a flash library instead.
  • Peripherals — 12-bit ADC, two 12-bit DACs, 8-channel PWM, 9 timer channels, four UARTs, SPI, two TWI (I2C), two CAN controllers, USB OTG and DMA.

Full Arduino Due Pinout

Here is the complete Arduino Due pinout. Each header pin shows its Arduino number, its SAM3X8E port (PAx/PBx/PCx/PDx) and its alternate functions: PWM, UART, I2C, ADC channel, DAC, CAN and SPI chip-select.

Detailed Arduino Due pinout diagram: every header pin with Arduino number, SAM3X8E port and function — digital 0-21, PWM 2-13, TX0-TX3/RX0-RX3, SDA/SCL, SDA1/SCL1, A0-A11 with AD channels, DAC0, DAC1, CANRX, CANTX and power pins — Power4All
Every pin around the Due's edge: power + A0–A11 + DAC + CAN on the left, PWM 13–2, serial 0–1 and the communication header 14–21 on the right.

The big 2 × 18 block at the end of the board carries digital pins 22–53. The centre SPI header is also shown here, because on the Due SPI is only available there:

Arduino Due digital pins 22-53 pinout with SAM3X8E port for each pin (PB26, PA14 ... PB14), plus the 6-pin SPI header pinout MISO, SCK, RESET, 5V, MOSI, GND — Power4All
Pins 22–53 with their SAM3X ports (even pins left, odd right; 5V on top, GND at the bottom) and the 6-pin SPI header.

Prefer the short version? These cards summarise every pin group and how many there are:

Arduino Due pin groups at a glance: 54 digital, 12 PWM, 12 analog inputs, 2 DAC, 4 serial ports, SPI, 2 I2C, CAN, 2 USB ports and power — Power4All
The Due at a glance: Mega-sized I/O, plus DAC, CAN and native USB.

Every Pin Explained

Now let's go through each group of pins and what it does. The layout matches the Mega 2560, but several functions sit on different pins, so the differences are called out below.

Digital pins (0–53)

54 general-purpose pins driven with pinMode(), digitalWrite() and digitalRead(). HIGH is 3.3 V, not 5 V. Each pin can only supply a small current (about 3–15 mA depending on the pin), and all pins together are limited to 130 mA, so drive LEDs gently and use a transistor or MOSFET for anything bigger. On the Due every digital pin can be an interrupt with attachInterrupt().

PWM (~): 12 pins

Pins 2–13. analogWrite() at about 1 kHz, 8-bit by default or up to 12-bit.

Interrupts: all pins

Unlike the Uno (2 pins) or Mega (6), any Due pin can trigger attachInterrupt().

SPI

MISO/MOSI/SCK are only on the 6-pin SPI header. Chip-selects: D4, D10, D52.

Two I2C buses

20 = SDA, 21 = SCL (Wire, 1.5 kΩ pull-ups) and SDA1/SCL1 (Wire1, no pull-ups).

Pin 13

Drives the on-board “L” LED (LED_BUILTIN), handy for a first test.

Pins 4 & 10

Each is wired to two SAM3X pins (PC26+PA29, PC29+PA28) so they also work as SPI chip-selects.

Serial (UART): four ports + SerialUSB

PortRX / TX pinsTypical use
Serial0 (RX0) / 1 (TX0)Programming USB port & Serial Monitor
Serial119 (RX1) / 18 (TX1)GPS, GSM, another MCU
Serial217 (RX2) / 16 (TX2)Bluetooth (3.3 V modules)
Serial315 (RX3) / 14 (TX3)RS-485 or a second board
SerialUSBNative USB portFast USB serial, independent of pins 0/1

Analog inputs (A0–A11)

12 analog inputs on a 12-bit ADC. They read 0–3.3 V as 0–1023 by default (for Uno compatibility) or as 0–4095 after analogReadResolution(12). They double as digital pins 54–65. The ADC reference is fixed at 3.3 V; the AREF pin is tied to it on the board.

DAC0 & DAC1: true analog outputs

Two 12-bit digital-to-analog converters at the end of the analog header. analogWrite(DAC0, value) sets a real, steady voltage from roughly 0.55 V to 2.75 V. There is more on this in the DAC section.

CANRX & CANTX

The logic-level pins of the SAM3X8E's CAN0 controller. A second controller, CAN1, sits on DAC0 (RX) and D53 (TX). Both need an external 3.3 V CAN transceiver to join a real bus.

Power & special pins

PinWhat it does
VINRaw input: 7–12 V recommended (6–16 V limit) to power the board.
5VRegulated 5 V output for modules, up to about 800 mA. Not a logic level for the Due's pins.
3.3VRegulated 3.3 V output, up to about 800 mA. The chip's own supply rail.
GNDGround (0 V), found in several places around the board.
IOREFReads 3.3 V, so smart shields can tell this is a 3.3 V board.
RESETPull LOW to restart the sketch (same as the RESET button).
AREFTied to 3.3 V on the Due; the ADC reference is fixed.
ERASE buttonWipes the flash so the SAM-BA ROM takes over (a recovery tool).
JTAG header10-pin debug port for hardware debuggers (step through code, breakpoints).
Coming from the Mega? Three gotchas

SPI is not on 50–53; it is only on the 6-pin SPI header. The board is 3.3 V, so many 5 V shields and modules need level shifting. And there's no EEPROM, so EEPROM.h sketches won't work unchanged.

The 3.3 V Logic Rule (Read This First)

This is the most important thing to know about the Due: its pins are 3.3 V and are not 5 V tolerant. A 5 V signal on any pin can permanently damage the SAM3X8E. Here is how to connect 5 V parts safely.

Arduino Due 3.3 V logic level shifting diagram: a 10k and 20k voltage divider for a 5 V output into a Due pin, and a bidirectional MOSFET logic-level shifter between the 3.3 V Due and a 5 V module — Power4All
Left: a 10 k / 20 k divider drops a 5 V output to ≈3.3 V. Right: a bidirectional level shifter for I2C, UART or SPI in both directions.

Voltage divider: Vout = Vin × R2 / (R1 + R2) = 5 V × 20 k / (10 k + 20 k) ≈ 3.33 V

  • 3.3 V sensors and modules (most modern I2C/SPI sensors, ESP modules, SD cards): connect directly.
  • 5 V outputs into the Due (HC-SR04 echo, 5 V UART TX): use a resistor divider or a shifter.
  • Due outputs into 5 V inputs: 3.3 V HIGH is often but not always enough; a level shifter makes it reliable.
  • Analog sensors powered at 5 V can output up to 5 V, so power them from 3.3V or divide the signal.

Powering the Due

The Due takes 5 V from either USB port, or 7–12 V from the DC jack or VIN. A switching regulator makes 5 V, and a second regulator makes the 3.3 V that the SAM3X8E and every I/O pin run on.

Arduino Due power supply diagram: USB 5 V or a 7-12 V DC jack through a switching 5 V regulator to the 5 V rail, then a 3.3 V regulator feeding the SAM3X8E and all I/O — Power4All
USB or the DC jack → 5 V rail → 3.3 V regulator → 3.3 V rail for the chip and every I/O pin.
Pins are signals, not power outlets

The 5V and 3.3V pins can each supply a few hundred mA to modules, but the I/O pins together only give about 130 mA. Motors, servos and LED strips need their own supply with a common ground.

The Two USB Ports: Programming vs Native

The Due has two micro-USB ports. They look the same but connect to the chip in completely different ways.

Arduino Due Programming port vs Native USB port diagram: Programming port through the ATmega16U2 to UART0 as Serial, Native port direct to the SAM3X8E USB OTG as SerialUSB, keyboard, mouse and USB host — Power4All
The Programming port goes through an ATmega16U2 to UART0 (Serial); the Native port goes straight into the SAM3X8E (SerialUSB).
Programming portNative USB port
LocationNext to the DC jackNext to the RESET button
PathATmega16U2 → UART0 (pins 0/1)Direct to SAM3X8E USB OTG
In codeSerialSerialUSB
Opening the portResets the boardDoes not reset the sketch
ExtrasMost reliable for uploadsKeyboard/Mouse HID, USB host, faster
IDE boardArduino Due (Programming Port)Arduino Due (Native USB Port)

PWM Output (~)

PWM fakes an analog voltage by switching a pin on and off quickly. The Due has 12 PWM pins (2–13) swinging 0–3.3 V, with resolution up to 12 bits.

Arduino Due PWM diagram: 25%, 50% and 75% duty cycles averaging 0.83 V, 1.65 V and 2.48 V on a 3.3 V pin, with analogWrite and analogWriteResolution(12) code — Power4All
On a 3.3 V board, 50% duty averages 1.65 V. Use analogWriteResolution(12) for 0–4095 steps.
// smooth 12-bit LED fade on PWM pin 9
void setup() { analogWriteResolution(12); }
void loop() {
  for (int v = 0; v <= 4095; v += 8)  { analogWrite(9, v); delayMicroseconds(500); }
  for (int v = 4095; v >= 0; v -= 8) { analogWrite(9, v); delayMicroseconds(500); }
}

Analog Input: the 12-bit ADC

The Due's 12 analog inputs feed a 12-bit ADC: 4096 steps across 0–3.3 V, about 0.8 mV per step, four times finer than the Uno's 10-bit ADC. Work out other resolutions with the ADC Resolution Calculator.

Arduino Due 12-bit ADC diagram: a potentiometer on A0 between 3.3 V and GND, mapping 0-3.3 V to 0-4095 with analogReadResolution(12) — Power4All
A potentiometer on A0 → 0–4095. Convert to volts with v * 3.3 / 4095.0.
// read all 12 analog inputs at full 12-bit resolution
void setup() { Serial.begin(115200); analogReadResolution(12); }
void loop() {
  for (int i = 0; i < 12; i++) {
    Serial.print(analogRead(A0 + i)); Serial.print(' ');
  }
  Serial.println();
  delay(250);
}

DAC: True Analog Output

This is something no Uno, Nano or Mega can do. DAC0 and DAC1 output a real, smooth analog voltage rather than a PWM square wave, with 12-bit resolution, so the Due can generate audio and waveforms directly.

Arduino Due DAC0 12-bit output diagram generating a sine wave between 0.55 V and 2.75 V with analogWrite(DAC0) code — Power4All
A sine wave built from 12-bit steps on DAC0. The output spans about 0.55 V (value 0) to 2.75 V (value 4095).
Treat the DAC pins gently

The DAC outputs are delicate. Never short them or connect them straight to a speaker or low-impedance load. Buffer them with an op-amp or an audio amplifier module.

Communication: UART, SPI, I2C & CAN

The Due has more buses than any classic Arduino: four UARTs plus SerialUSB, SPI, two I2C buses and two CAN controllers.

Arduino Due communication buses diagram: four UARTs plus SerialUSB, SPI on the 6-pin header with chip-selects D4 D10 D52, I2C on 20/21 and SDA1/SCL1, and two CAN controllers — Power4All
UART × 4, SPI on the centre header, Wire (20/21) + Wire1 (SDA1/SCL1), and CAN0 + CAN1.

CAN bus

CAN is the rugged two-wire network used in cars, e-bikes, robots and industrial machines. The SAM3X8E handles the CAN protocol in hardware; add a 3.3 V CAN transceiver (such as an SN65HVD230 module) and 120 Ω terminators at both ends of the bus.

Arduino Due CAN bus network diagram: CANTX and CANRX to a 3.3 V CAN transceiver, twisted-pair CANH and CANL lines with 120 ohm termination resistors and other CAN nodes — Power4All
Every node needs a transceiver; the bus is a twisted pair with a 120 Ω resistor at each end.

How Code Gets onto the Due

Uploading works differently from AVR boards. The IDE first erases the flash with a “1200-baud touch”, then bossac writes your program through the SAM-BA boot ROM.

Arduino Due upload flow diagram: write the sketch, compile with ARM GCC, send over the Programming USB port, 1200-baud erase, bossac and SAM-BA write the flash, run — Power4All
Write → compile (ARM GCC) → USB → erase → bossac + SAM-BA flash → run.
First time? Install the SAM core

Open Tools → Board → Boards Manager, install Arduino SAM Boards (32-bits ARM Cortex-M3), then choose Arduino Due (Programming Port). If an upload fails with “No device found”, hold ERASE for a second, press RESET, and upload again.

Due vs Mega 2560 vs Uno

The Due and Mega 2560 share a board shape and pin count, but inside they are very different machines.

Arduino Due vs Mega 2560 vs Uno comparison table: 32-bit ARM vs 8-bit AVR, 84 MHz vs 16 MHz, 3.3 V vs 5 V, flash, SRAM, EEPROM, pins, ADC, DAC, serial, CAN and native USB — Power4All
Faster, bigger and better connected, but 3.3 V and without EEPROM. The Uno is shown for scale.

Choose the Due for speed, audio/DSP, the DAC, CAN, native USB or big memory. Choose the Mega for 5 V shields and modules, EEPROM or 16 analog inputs. Choose the Uno for learning. Need Wi-Fi? Look at the ESP32.

Code Examples

Standard Arduino code runs unchanged. These examples also use the Due's own features: 12-bit I/O, the DAC and SerialUSB.

1. Blink the on-board LED

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);       // pin 13
}
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);
}

2. Output a steady analog voltage on DAC0

void setup() {
  analogWriteResolution(12);          // 0-4095
  analogWrite(DAC0, 2048);            // about 1.65 V, mid-scale
}
void loop() {}

3. Print over the Native USB port

void setup() {
  SerialUSB.begin(115200);            // Native port (baud is ignored, it's full-speed USB)
  while (!SerialUSB);                 // wait for the PC to open the port
}
void loop() {
  SerialUSB.println(millis());
  delay(500);
}

4. Interrupt on any pin

volatile int presses = 0;
void onPress() { presses++; }
void setup() {
  Serial.begin(115200);
  pinMode(30, INPUT_PULLUP);                               // any Due pin works
  attachInterrupt(digitalPinToInterrupt(30), onPress, FALLING);
}
void loop() { Serial.println(presses); delay(500); }

Beginner Mini-Projects

Four complete projects. The first works on any Arduino; the others show off what makes the Due special.

Arduino Due Blink project wiring diagram: an LED and 220 ohm resistor on pin 13 with about 6 mA at 3.3 V, and the blink sketch — Power4All
Project 1 wiring. At 3.3 V a 220 Ω resistor gives about 6 mA, comfortably within the pin's limit. Check other values with the LED resistor calculator.

Project 1: Blink an LED

Parts: 1 LED, 1 × 220 Ω resistor. LED anode → resistor → pin 13; cathode → GND.
void setup() { pinMode(13, OUTPUT); }
void loop() {
  digitalWrite(13, HIGH); delay(500);
  digitalWrite(13, LOW);  delay(500);
}

Project 2: DAC sine-wave generator

Parts: none, or an oscilloscope / amplified speaker module on DAC0 and GND. Uses a pre-computed lookup table for speed.
const int N = 100;
uint16_t table[N];
void setup() {
  analogWriteResolution(12);
  for (int i = 0; i < N; i++)
    table[i] = 2048 + 2047 * sin(2 * PI * i / N);
}
void loop() {
  for (int i = 0; i < N; i++) {
    analogWrite(DAC0, table[i]);
    delayMicroseconds(10);                   // sets the frequency
  }
}

Project 3: 12-bit precision voltmeter

Parts: a potentiometer (ends to 3.3V and GND, wiper to A0). For 0–5 V inputs add a 10 k / 20 k divider. Reads in about 0.8 mV steps.
void setup() { Serial.begin(115200); analogReadResolution(12); }
void loop() {
  long sum = 0;
  for (int i = 0; i < 64; i++) sum += analogRead(A0);  // average 64 samples
  float volts = (sum / 64.0) * 3.3 / 4095.0;
  Serial.print(volts, 4); Serial.println(" V");
  delay(300);
}

Project 4: USB keyboard button (Native port)

Parts: a push-button from pin 2 to GND. Upload with Arduino Due (Native USB Port); each press types text on the PC like a real keyboard.
#include <Keyboard.h>
void setup() { pinMode(2, INPUT_PULLUP); Keyboard.begin(); }
void loop() {
  if (digitalRead(2) == LOW) {
    Keyboard.println("Hello from Arduino Due!");
    delay(500);                                // simple debounce
  }
}

Specifications

The Arduino Due at a glance.

Arduino Due specifications table: SAM3X8E ARM Cortex-M3, 84 MHz, 3.3 V, 7-12 V input, 512 KB flash, 96 KB SRAM, 54 digital pins, 12 analog inputs, 2 DAC, 4 UART, SPI, I2C, CAN, USB — Power4All
Key numbers for the Due: MCU, clock, voltages, memory, pins, buses and size.

Key Terms — Glossary

TermMeaning
ARM Cortex-M3A 32-bit processor core designed for microcontrollers; the heart of the SAM3X8E.
SAM3X8EThe Due's microcontroller: 84 MHz, 512 KB flash, 96 KB SRAM.
3.3 V logicHIGH = 3.3 V. Due pins must never see 5 V.
Level shifterA circuit that translates signals between 3.3 V and 5 V.
DACDigital-to-analog converter; DAC0/DAC1 output a real voltage.
ADCAnalog-to-digital converter; 12-bit on the Due (0–4095).
PWM (~)Pulse-width modulation; pins 2–13 on the Due.
SerialUSBThe serial port of the Native USB connector.
CANController Area Network: a robust 2-wire bus used in vehicles and machines.
SAM-BA / bossacThe boot ROM and the PC tool that together write sketches to flash.
JTAGA debug interface for stepping through code with a hardware debugger.
DMADirect memory access: moves data between peripherals and RAM without the CPU.

Frequently Asked Questions

Quick answers to the questions people ask most about the Arduino Due.

What is the Arduino Due?

The first Arduino with a 32-bit ARM core: a SAM3X8E Cortex-M3 at 84 MHz with 512 KB flash and 96 KB SRAM. It has 54 digital pins (12 PWM), 12 analog inputs, 2 DAC outputs, four UARTs, SPI, two I2C buses, CAN and two USB ports, all at 3.3 V logic, on the Mega 2560's footprint.

Is the Arduino Due 5 V tolerant?

No. The Due runs at 3.3 V and its pins are not 5 V tolerant. More than 3.3 V on any pin can permanently damage the SAM3X8E. Use a voltage divider or logic-level shifter for 5 V sensors and modules.

How many pins does the Arduino Due have?

54 digital I/O pins (0–53), with PWM on 2–13; 12 analog inputs (A0–A11); DAC0 and DAC1; CANRX/CANTX; SDA1/SCL1; a 6-pin SPI header; a JTAG header; and power pins 5V, 3.3V, VIN, GND, IOREF, RESET and AREF.

What microcontroller does the Arduino Due use?

The SAM3X8E, a 32-bit ARM Cortex-M3 at 84 MHz with 512 KB flash (two banks), 96 KB SRAM, a SAM-BA boot ROM, DMA, a 12-bit ADC, two 12-bit DACs, PWM and timers, four UARTs, SPI, two TWI (I2C), two CAN controllers and USB OTG.

What is the difference between the Programming and Native USB ports on the Due?

The Programming port goes through an ATmega16U2 to UART0, so it appears as Serial and resets the board when opened. The Native port connects straight to the SAM3X8E's USB controller: it appears as SerialUSB, is faster, and lets the Due act as a USB keyboard, mouse or host. Both can upload sketches.

How do I program the Arduino Due?

Install Arduino SAM Boards (32-bits ARM Cortex-M3) in the Boards Manager, connect the Programming port, choose Arduino Due (Programming Port) and the COM port, and click Upload. The IDE erases the flash and bossac writes the sketch through the SAM-BA ROM. If it gets stuck, press ERASE, then RESET, and retry.

Does the Arduino Due have a DAC?

Yes, two 12-bit DAC outputs: DAC0 and DAC1. They produce a true analog voltage from about 0.55 V to 2.75 V. Use analogWriteResolution(12) and analogWrite(DAC0, 0–4095) for audio, sine waves or analog set-points.

Arduino Due vs Mega 2560: which should I use?

Both have 54 digital pins and the same board shape. Choose the Due for speed (84 MHz 32-bit ARM vs 16 MHz 8-bit AVR), more memory, the DAC, CAN, native USB or 12-bit analog. Choose the Mega for 5 V logic, EEPROM, 16 analog inputs or full compatibility with 5 V shields and AVR libraries.

Conclusion & Key Takeaways

The Arduino Due brings 32-bit ARM power to the familiar Arduino workflow. It is Mega-sized, much faster, and full of features the 8-bit boards lack. Just remember that it runs at 3.3 V.

SAM3X8E

32-bit ARM, 84 MHz.

3.3 V only

Never 5 V on a pin.

54 + 12 pins

12 PWM, 12-bit ADC.

2 DAC

True analog out.

2 USB ports

Serial + SerialUSB.

CAN + SPI header

SPI not on 50–53.

Continue Learning