Arduino Leonardo (ATmega32U4)
Arduino Leonardo: ATmega32U4 at 16 MHz with native USB, runs Arduino sketches (arduino:avr:leonardo) or HEX / ELF. Serial is the USB port to the PC (the serial monitor), Serial1 is D0/D1; with Keyboard.h / Mouse.h the board types and moves the mouse on the PC (shown in the console). analogWrite on D3, D5, D6, D9, D10, D11, D13; A0–A5 (and D4, D6, D8, D9, D10, D12 as A6–A11); attachInterrupt on D0–D3, D7; Wire on D2/D3; SPI on the ICSP header (D14–D16).
Key data
- Category
- Arduino
- Simulation model
- Microcontroller with real firmware
- Manufacturer part number
- Arduino Leonardo (A000057)
- Reference prefix
- A
- Pins
- 28
- Land pattern
- Arduino_UNO_R3
Notes
The firmware runs on an emulated CPU core, instruction by instruction. Peripherals that the model implements (GPIO, timers, UART, SPI, I²C, ADC and others, see the description) act on the pins of the circuit, so the analog parts around the chip see the same voltages and timing as on a real board.
- With supply "usb" the board is connected to the PC: Serial is the USB port (serial monitor), Keyboard / Mouse reach the PC (shown in the console).
- Serial1 is D0/D1; they are free for your own devices.
- Right-click the part and choose "Open in code editor" to write and compile its code; "Serial monitor" shows its UART output.
- In the inspector you can load a demo firmware or your own ELF / Intel HEX / BIN file instead.
- GPIO pins are real circuit pins: an LED on an output needs a series resistor, an input needs a defined level (pull-up or pull-down).
- The debugger in the code view stops at breakpoints and shows registers, variables and the call stack.
Simulation model
An emulated CPU core runs the firmware binary instruction by instruction. The GPIO pins are pins of the analog circuit: outputs drive through a driver resistance, inputs read the voltage with thresholds.
- Device
- atmega32u4
- CPU core
- AVR 8-bit
- Emulator
- AVR emulator with USB device controller
- Firmware
- Arduino sketch compiled in the code view (arduino-cli, arduino:avr), or your own ELF / Intel HEX / BIN file
- Flash / RAM for firmware
- 32 KB / 2.5 KB
- Supply pins
- 5V / GND
- Mapped GPIO pins
- 24
Pins 28
simulatedreal chip onlyPin functions from the emulator and the datasheet.
| Pin | Name | Functions | Use |
|---|---|---|---|
| 5V | 5VSupply pin | Supply 5 V (regulated): powers the board, or 5 V output when powered over USB | |
| GND | GNDGround pin | Ground | |
| 3V3 | 3V3Output pin | Supply input: decouple with 100 nF close to the pin | |
| VIN | VINSupply pin · pulled down on the board | Supply input: decouple with 100 nF close to the pin | |
| D0 | D0/RXI/O pin | USART1_RXDINT2 | Serial data in: from the TX pin of the other device |
| D1 | D1/TXI/O pin | USART1_TXDINT3 | Serial data out: to the RX pin of the other device (console, GPS, modules) |
| D2 | D2/SDAI/O pin | TWI_SDAINT1 | I²C data: pull-up (about 4.7 kΩ) to the supply |
| D3 | ~D3/SCLI/O pin | TWI_SCLOC0BINT0 | I²C clock: sensors, displays; pull-up (about 4.7 kΩ) to the supply |
| D4 | D4I/O pin | ADC8ICP1 | Analog input: potentiometer, sensor voltage (0 V … supply) |
| D5 | ~D5I/O pin | OC3A!OC4A | PWM output: LED dimming, servos, motor drivers |
| D6 | ~D6I/O pin | ADC10OC4D | Analog input: potentiometer, sensor voltage (0 V … supply) |
| D7 | D7I/O pin | INT6AIN0 | Analog input: potentiometer, sensor voltage (0 V … supply) |
| D8 | D8I/O pin | ADC11PCINT4 | Analog input: potentiometer, sensor voltage (0 V … supply) |
| D9 | ~D9I/O pin | ADC12OC1APCINT5!OC4B | Analog input: potentiometer, sensor voltage (0 V … supply) |
| D10 | ~D10I/O pin | ADC13OC1BPCINT6OC4B | Analog input: potentiometer, sensor voltage (0 V … supply) |
| D11 | ~D11I/O pin | OC0AOC1CPCINT7 | PWM output: LED dimming, servos, motor drivers |
| D12 | D12I/O pin | ADC9!OC4D | Analog input: potentiometer, sensor voltage (0 V … supply) |
| D13 | ~D13I/O pin | ICP3OC4A | On-board LED "L"; PWM (Timer4) |
| A0 | A0I/O pin | ADC7 | Analog input: potentiometer, sensor voltage (0 V … supply) |
| A1 | A1I/O pin | ADC6 | Analog input: potentiometer, sensor voltage (0 V … supply) |
| A2 | A2I/O pin | ADC5 | Analog input: potentiometer, sensor voltage (0 V … supply) |
| A3 | A3I/O pin | ADC4 | Analog input: potentiometer, sensor voltage (0 V … supply) |
| A4 | A4I/O pin | ADC1 | Analog input: potentiometer, sensor voltage (0 V … supply) |
| A5 | A5I/O pin | ADC0 | Analog input: potentiometer, sensor voltage (0 V … supply) |
| D14 | D14/MISOI/O pin | SPI_MISOPCINT3 | SPI data in (MISO): from DOUT / SDO of the device |
| D15 | D15/SCKI/O pin | SPI_SCKPCINT1 | SPI clock: displays, flash, SD cards |
| D16 | D16/MOSII/O pin | SPI_MOSIPCINT2 | SPI data out (MOSI): to DIN / SDA / SDI of the device |
| RESET | RESETInput pin · pulled up on the board | RESET | Reset, active low: pull to GND to restart the sketch |
Parameters 1
supplyusb: the USB cable to the PC powers the board and carries Serial (USB CDC), keyboard and mouse (HID); extern: no USB, supply through the 5V / VIN pins
PCB
Arduino_UNO_R3| Package | Land pattern | Status | Source |
|---|---|---|---|
| Shield | Arduino_UNO_R3 | Verified land pattern | KiCad 10.0.7: symbol Arduino_Leonardo, footprint Module:Arduino_UNO_R3; as a shield: Leonardo / Uno R3 socket headers (pin headers on your own board); D14–D16 only on the ICSP header |