Arduino · A000005
Arduino Nano
Arduino Nano: an ATmega328P (8-bit AVR, 16 MHz) at 5 V on a breadboard stick, with a USB-serial chip.
In short
The UNO's chip on a breadboard stick: an ATmega328P at 16 MHz, 32 KB flash, 2 KB SRAM, 5 V pins. 14 digital pins (6 PWM) and 8 analog inputs (A6 and A7 analog only).
Specs
From the board’s model in the store.
- Processor
- ATmega328P · 1× AVR · chip "atmega328p"
- Clock
- 16 MHz
- Flash
- 32 KB
- RAM
- 2 KB
- GPIO pins
- 20
- ADC
- ADC 8 ch 10-bit
- Logic level
- 5 V
- Power
- 5 V USB, or 7 V to 12 V on VIN (in); 3V3 pin (from the USB-serial chip): 3.3 V (≤ 50 mA); 5V pin (from USB): 5 V (≤ 500 mA)
- Current per pin
- 20 mA
- Buses
- UART ×1, I²C ×1, SPI ×1
- Runs
- bare metal (no OS)
Pin map
Each pin by what it does. Hover or tap a pin to see what else it can be.
- Power 3
- Ground 1
- Digital 8
- Analog 6
- Bus 6
- Control 2
- PD0D0 (RX)
- PD1D1 (TX)
- PD2D2 (INT0)
- PD3D3 (PWM, INT1)
- PD4D4
- PD5D5 (PWM)
- PD6D6 (PWM)
- PD7D7
- PB0D8
- PB1D9 (PWM)
- PB2D10 (PWM, SS)
- PB3D11 (PWM, MOSI)
- PB4D12 (MISO)
- PB5D13 (SCK, LED L)
- PC0A0
- PC1A1
- PC2A2
- PC3A3
- PC4A4 (SDA)
- PC5A5 (SCL)
- ADC6A6 (analog only)
- ADC7A7 (analog only)
- pwr5 V USB, or 7 V to 12 V on VIN
- v3v33V3 pin (from the USB-serial chip)
- v55V pin (from USB)
- gndGND
Watch out
What archec checks for this board, from its data. Each one names the check that catches it.
Its pins give 5 V. A 3.3 V part on one of them needs a level shifter between them.
check
pin-levelOne pin gives at most 20 mA. An LED needs a resistor; a motor or a relay needs a driver.
check
pin-currentTwo of the board’s connectors share these pins: PB5 (LED L (D13) / SPI (D13, D11, D12, D10) / D13 (SCK, LED L)), PD1 (USART0 (D1, D0: the USB serial too) / D1 (TX)), PD0 (USART0 (D1, D0: the USB serial too) / D0 (RX)), PC4 (TWI, the I²C (A4, A5) / A4 (SDA)), PC5 (TWI, the I²C (A4, A5) / A5 (SCL)), PB3 (SPI (D13, D11, D12, D10) / D11 (PWM, MOSI)), PB4 (SPI (D13, D11, D12, D10) / D12 (MISO)), PB2 (SPI (D13, D11, D12, D10) / D10 (PWM, SS)). Use one or the other.
check
pin-conflictThe board already uses PB5 (LED L (D13)), PD0 (D0 (RX)), PD1 (D1 (TX)), PD2 (D2 (INT0)), PD3 (D3 (PWM, INT1)), PD4 (D4), PD5 (D5 (PWM)), PD6 (D6 (PWM)), PD7 (D7), PB0 (D8), PB1 (D9 (PWM)), PB2 (D10 (PWM, SS)), PB3 (D11 (PWM, MOSI)), PB4 (D12 (MISO)), PB5 (D13 (SCK, LED L)), PC0 (A0), PC1 (A1), PC2 (A2), PC3 (A3), PC4 (A4 (SDA)), PC5 (A5 (SCL)). Something else wired there fights with it.
check
pin-conflictThe 3V3 pin (from the USB-serial chip) gives at most 50 mA at 3.3 V. Add up what you power from it.
check
board-currentThe 5V pin (from USB) gives at most 500 mA at 5 V. Add up what you power from it.
check
board-currentIt gives 3.3 V (3V3 pin (from the USB-serial chip)), 5 V (5V pin (from USB)). Power each part from a rail at its own voltage.
check
board-supplyIt has 1 UART, 1 I²C, 1 SPI. One more bus of a kind than that is an error.
check
board-peripheralEach bus goes on the pins that can carry it (see the pin map). Another pin is an error.
check
pin-function
First model
A blink for this board: the board, an LED and a part that turns it over every 500 ms. archec checks it, then writes the code on the right.
project Blink "Blink" {
version "0.1.0"
edition "1.0"
uses arche-hw-store "^0.1"
}
include "arche-hw-store/boards/arduino-nano/arduino-nano.arche"
include "arche-hw-store/devices/led/led.arche"
/// Turns the LED over at each step.
component Blinker "Blinker" {
out led: requires Led
fn blink "Blink" {
```arche
led.toggle()
```
wcet 50us
}
}
/// The board, an LED on the board's LED L (D13) (PB5), and the blinker.
system Hw "Blink" {
part board: ArduinoNano
part led: GpioLed { in pin { pins { pin PB5 } } }
part blinker: Blinker
blinker.led -> led.led
}
/// The firmware: the blinker every 500 ms.
deployment OnBoard "On the board" {
system Hw
platform Hw
binary blink on board {
thread main "Blink" { runs blinker; period 500ms; step blink }
}
}
/* Generated by archec: component Blinker. Do not edit outside the USER CODE regions: run `archec gen --target c` again, it keeps them. */
#include "blinker.h"
#include "arche_rt.h"
#include <math.h>
/* USER CODE BEGIN Blinker.includes */
/* USER CODE END Blinker.includes */
/* @arche Blinker.init main.arche:11 init */
void blinker_init(blinker_t *self)
{
(void)self;
/* USER CODE BEGIN Blinker.init */
/* USER CODE END Blinker.init */
}
/* @arche Blinker.blink main.arche:13 fn */
void blinker_blink(blinker_t *self)
{
blinker_call_led_toggle(self);
}blinker.c, one of the 18 files archec writes.
Parts on the board
What each numbered part is. Click a number to find it on the board.
Find the part
The quiz names a part: click it on the board. A first try scores a point.