deckle studio
Open the editor
Microcontroller with real firmwareArduino Leonardo (A000057)arduino_leonardo

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).

5VGND3V3VIND0/RXD1/TXD2/SDA~D3/SCLD4~D5~D6D7D8~D9~D10~D11D12~D13A0A1A2A3A4A5D14/MISOD15/SCKD16/MOSIRESETArduino Leonardo (A000057)
Schematic symbol

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.

PinNameFunctionsUse
5V5VSupply pinSupply 5 V (regulated): powers the board, or 5 V output when powered over USB
GNDGNDGround pinGround
3V33V3Output pinSupply input: decouple with 100 nF close to the pin
VINVINSupply pin · pulled down on the boardSupply input: decouple with 100 nF close to the pin
D0D0/RXI/O pinUSART1_RXDINT2Serial data in: from the TX pin of the other device
D1D1/TXI/O pinUSART1_TXDINT3Serial data out: to the RX pin of the other device (console, GPS, modules)
D2D2/SDAI/O pinTWI_SDAINT1I²C data: pull-up (about 4.7 kΩ) to the supply
D3~D3/SCLI/O pinTWI_SCLOC0BINT0I²C clock: sensors, displays; pull-up (about 4.7 kΩ) to the supply
D4D4I/O pinADC8ICP1Analog input: potentiometer, sensor voltage (0 V … supply)
D5~D5I/O pinOC3A!OC4APWM output: LED dimming, servos, motor drivers
D6~D6I/O pinADC10OC4DAnalog input: potentiometer, sensor voltage (0 V … supply)
D7D7I/O pinINT6AIN0Analog input: potentiometer, sensor voltage (0 V … supply)
D8D8I/O pinADC11PCINT4Analog input: potentiometer, sensor voltage (0 V … supply)
D9~D9I/O pinADC12OC1APCINT5!OC4BAnalog input: potentiometer, sensor voltage (0 V … supply)
D10~D10I/O pinADC13OC1BPCINT6OC4BAnalog input: potentiometer, sensor voltage (0 V … supply)
D11~D11I/O pinOC0AOC1CPCINT7PWM output: LED dimming, servos, motor drivers
D12D12I/O pinADC9!OC4DAnalog input: potentiometer, sensor voltage (0 V … supply)
D13~D13I/O pinICP3OC4AOn-board LED "L"; PWM (Timer4)
A0A0I/O pinADC7Analog input: potentiometer, sensor voltage (0 V … supply)
A1A1I/O pinADC6Analog input: potentiometer, sensor voltage (0 V … supply)
A2A2I/O pinADC5Analog input: potentiometer, sensor voltage (0 V … supply)
A3A3I/O pinADC4Analog input: potentiometer, sensor voltage (0 V … supply)
A4A4I/O pinADC1Analog input: potentiometer, sensor voltage (0 V … supply)
A5A5I/O pinADC0Analog input: potentiometer, sensor voltage (0 V … supply)
D14D14/MISOI/O pinSPI_MISOPCINT3SPI data in (MISO): from DOUT / SDO of the device
D15D15/SCKI/O pinSPI_SCKPCINT1SPI clock: displays, flash, SD cards
D16D16/MOSII/O pinSPI_MOSIPCINT2SPI data out (MOSI): to DIN / SDA / SDI of the device
RESETRESETInput pin · pulled up on the boardRESETReset, active low: pull to GND to restart the sketch

Parameters 1

Supplysupply
Defaultusb
usbextern

usb: 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

Verified land patternArduino_UNO_R3
PackageLand patternStatusSource
ShieldArduino_UNO_R3Verified land patternKiCad 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