Atmel AVR

platform = atmelavr

Atmel AVR 8- and 32-bit MCUs deliver a unique combination of performance, power efficiency and design flexibility. Optimized to speed time to market-and easily adapt to new ones-they are based on the industrys most code-efficient architecture for C and assembly programming.

For more detailed information please visit vendor site.

Configuration

Upload using Programmer

To upload firmware using programmer you need to use program target instead of upload for platformio run --target command. For example, platformio run -t program.

Warning

Upload options like upload_port don’t work as expected with platformio run -t program. You need to use upload_flags if you want to specify custom port or speed (see examples below).

Note

List of avrdude supported programmers are accessible with avrdude -c ?

Configuration for the programmers:

  • AVR ISP

    [env:myenv]
    platform = atmelavr
    framework = arduino
    upload_protocol = stk500v1
    upload_flags = -P$UPLOAD_PORT
    
    ; edit this line with valid upload port
    upload_port = SERIAL_PORT_HERE
    
  • AVRISP mkII

    [env:myenv]
    platform = atmelavr
    framework = arduino
    upload_protocol = stk500v2
    upload_flags = -Pusb
    
  • USBtinyISP

    [env:myenv]
    platform = atmelavr
    framework = arduino
    upload_protocol = usbtiny
    
  • ArduinoISP

    [env:myenv]
    platform = atmelavr
    framework = arduino
    upload_protocol = arduinoisp
    
  • USBasp

    [env:myenv]
    platform = atmelavr
    framework = arduino
    upload_protocol = usbasp
    upload_flags = -Pusb
    
  • Parallel Programmer

    [env:myenv]
    platform = atmelavr
    framework = arduino
    upload_protocol = dapa
    upload_flags = -F
    
  • Arduino as ISP

    [env:myenv]
    platform = atmelavr
    framework = arduino
    upload_protocol = stk500v1
    upload_flags = -P$UPLOAD_PORT -b$UPLOAD_SPEED
    
    ; edit these lines
    upload_port = SERIAL_PORT_HERE
    upload_speed = 19200
    
  • Bus Pirate as ISP

    [env:myenv]
    platform = atmelavr
    framework = arduino
    upload_protocol = buspirate
    upload_flags = -P$UPLOAD_PORT -b$UPLOAD_SPEED
    
    ; edit these lines
    upload_port = SERIAL_PORT_HERE
    upload_speed = 115200
    

Upload EEPROM data

To upload EEPROM data (from EEMEM directive) you need to use uploadeep target instead upload for platformio run --target command. For example, platformio run -t uploadeep.

Fuses

PlatformIO has built-in target named fuses for setting fuse bits. The default fuse bits are predefined in board manifest file in fuses section. For example, Arduino Uno Fuses.

To set fuse bits you need to use target fuses for platformio run --target command.

Custom Fuses

You can specify custom fuse bits. Please create custom extra_scripts and override default “fuses” command:

platformio.ini:

[env:custom_fuses]
platform = atmelavr
extra_scripts = extra_script.py

extra_script.py:

Import('env')
env.Replace(FUSESCMD="avrdude $UPLOADERFLAGS -e -Ulock:w:0x3F:m -Uhfuse:w:0xDE:m -Uefuse:w:0x05:m -Ulfuse:w:0xFF:m")

Examples

Examples are listed from Atmel AVR development platform repository:

Stable and upstream versions

You can switch between stable releases of Atmel AVR development platform and the latest upstream version using platform option as described below:

; Custom stable version
[env:stable]
platform =atmelavr@x.y.z
board = ...
...

; The latest upstream/development version
[env:upstream]
platform = https://github.com/platformio/platform-atmelavr.git
board = ...
...

Packages

Name

Description

framework-arduinoavr

Arduino Wiring-based Framework (AVR Core, 1.6)

framework-simba

Simba Framework

tool-avrdude

AVRDUDE

tool-micronucleus

Micronucleus

toolchain-atmelavr

avr-gcc

Warning

Linux Users:

Windows Users:

Please check that you have a correctly installed USB driver from board manufacturer

Frameworks

Name

Description

Arduino

Arduino Wiring-based Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.

Simba

Simba is an RTOS and build framework. It aims to make embedded programming easy and portable.

Boards

Note

Adafruit

ID

Name

Debug

MCU

Frequency

Flash

RAM

bluefruitmicro

Adafruit Bluefruit Micro

No

ATMEGA32U4

8MHz

28KB

2.50KB

feather32u4

Adafruit Feather

No

ATMEGA32U4

8MHz

28KB

2.50KB

flora8

Adafruit Flora

No

ATMEGA32U4

8MHz

28KB

2.50KB

gemma

Adafruit Gemma

No

ATTINY85

8MHz

8KB

512B

metro

Adafruit Metro

No

ATMEGA328P

16MHz

31.50KB

2KB

protrinket3

Adafruit Pro Trinket 3V/12MHz (USB)

No

ATMEGA328P

12MHz

28KB

2KB

protrinket3ftdi

Adafruit Pro Trinket 3V/12MHz (FTDI)

No

ATMEGA328P

12MHz

28KB

2KB

protrinket5

Adafruit Pro Trinket 5V/16MHz (USB)

No

ATMEGA328P

16MHz

28KB

2KB

protrinket5ftdi

Adafruit Pro Trinket 5V/16MHz (FTDI)

No

ATMEGA328P

16MHz

28KB

2KB

trinket3

Adafruit Trinket 3V/8MHz

No

ATTINY85

8MHz

8KB

512B

trinket5

Adafruit Trinket 5V/16MHz

No

ATTINY85

16MHz

8KB

512B

Alorium Technology

ID

Name

Debug

MCU

Frequency

Flash

RAM

alorium_xlr8

Alorium XLR8

No

ATMEGA328P

16MHz

31.50KB

2KB

Anarduino

ID

Name

Debug

MCU

Frequency

Flash

RAM

miniwireless

Anarduino MiniWireless

No

ATMEGA328P

16MHz

31.50KB

2KB

Arduboy

ID

Name

Debug

MCU

Frequency

Flash

RAM

arduboy

Arduboy

No

ATMEGA32U4

16MHz

28KB

2.50KB

arduboy_devkit

Arduboy DevKit

No

ATMEGA32U4

16MHz

28KB

2.50KB

Arduino

ID

Name

Debug

MCU

Frequency

Flash

RAM

LilyPadUSB

Arduino LilyPad USB

No

ATMEGA32U4

8MHz

28KB

2.50KB

atmega328pb

Atmel ATmega328PB

No

ATMEGA328PB

16MHz

31.50KB

2KB

atmegangatmega168

Arduino NG or older ATmega168

No

ATMEGA168

16MHz

14KB

1KB

atmegangatmega8

Arduino NG or older ATmega8

No

ATMEGA8

16MHz

7KB

1KB

btatmega168

Arduino BT ATmega168

No

ATMEGA168

16MHz

14KB

1KB

btatmega328

Arduino BT ATmega328

No

ATMEGA328P

16MHz

28KB

2KB

chiwawa

Arduino Industrial 101

No

ATMEGA32U4

16MHz

28KB

2.50KB

diecimilaatmega168

Arduino Duemilanove or Diecimila ATmega168

No

ATMEGA168

16MHz

14KB

1KB

diecimilaatmega328

Arduino Duemilanove or Diecimila ATmega328

No

ATMEGA328P

16MHz

30KB

2KB

esplora

Arduino Esplora

No

ATMEGA32U4

16MHz

28KB

2.50KB

ethernet

Arduino Ethernet

No

ATMEGA328P

16MHz

31.50KB

2KB

fio

Arduino Fio

No

ATMEGA328P

8MHz

30KB

2KB

leonardo

Arduino Leonardo

No

ATMEGA32U4

16MHz

28KB

2.50KB

leonardoeth

Arduino Leonardo ETH

No

ATMEGA32U4

16MHz

28KB

2.50KB

lilypadatmega168

Arduino LilyPad ATmega168

No

ATMEGA168

8MHz

14KB

1KB

lilypadatmega328

Arduino LilyPad ATmega328

No

ATMEGA328P

8MHz

30KB

2KB

megaADK

Arduino Mega ADK

No

ATMEGA2560

16MHz

248KB

8KB

megaatmega1280

Arduino Mega or Mega 2560 ATmega1280

No

ATMEGA1280

16MHz

124KB

8KB

megaatmega2560

Arduino Mega or Mega 2560 ATmega2560 (Mega 2560)

No

ATMEGA2560

16MHz

248KB

8KB

micro

Arduino Micro

No

ATMEGA32U4

16MHz

28KB

2.50KB

miniatmega168

Arduino Mini ATmega168

No

ATMEGA168

16MHz

14KB

1KB

miniatmega328

Arduino Mini ATmega328

No

ATMEGA328P

16MHz

28KB

2KB

nanoatmega168

Arduino Nano ATmega168

No

ATMEGA168

16MHz

14KB

1KB

nanoatmega328

Arduino Nano ATmega328

No

ATMEGA328P

16MHz

30KB

2KB

pro16MHzatmega168

Arduino Pro or Pro Mini ATmega168 (5V, 16 MHz)

No

ATMEGA168

16MHz

14KB

1KB

pro16MHzatmega328

Arduino Pro or Pro Mini ATmega328 (5V, 16 MHz)

No

ATMEGA328P

16MHz

30KB

2KB

pro8MHzatmega168

Arduino Pro or Pro Mini ATmega168 (3.3V, 8 MHz)

No

ATMEGA168

8MHz

14KB

1KB

pro8MHzatmega328

Arduino Pro or Pro Mini ATmega328 (3.3V, 8 MHz)

No

ATMEGA328P

8MHz

30KB

2KB

robotControl

Arduino Robot Control

No

ATMEGA32U4

16MHz

28KB

2.50KB

robotMotor

Arduino Robot Motor

No

ATMEGA32U4

16MHz

28KB

2.50KB

uno

Arduino Uno

No

ATMEGA328P

16MHz

31.50KB

2KB

yun

Arduino Yun

No

ATMEGA32U4

16MHz

28KB

2.50KB

yunmini

Arduino Yun Mini

No

ATMEGA32U4

16MHz

28KB

2.50KB

BQ

ID

Name

Debug

MCU

Frequency

Flash

RAM

zumbt328

BQ ZUM BT-328

No

ATMEGA328P

16MHz

28KB

2KB

BitWizard

ID

Name

Debug

MCU

Frequency

Flash

RAM

raspduino

BitWizard Raspduino

No

ATMEGA328P

16MHz

30KB

2KB

Controllino

ID

Name

Debug

MCU

Frequency

Flash

RAM

controllino_maxi

Controllino Maxi

No

ATMEGA2560

16MHz

248KB

8KB

controllino_maxi_automation

Controllino Maxi Automation

No

ATMEGA2560

16MHz

248KB

8KB

controllino_mega

Controllino Mega

No

ATMEGA2560

16MHz

248KB

8KB

controllino_mini

Controllino Mini

No

ATMEGA328P

16MHz

31.50KB

2KB

Digistump

ID

Name

Debug

MCU

Frequency

Flash

RAM

digispark-pro

Digispark Pro

No

ATTINY167

16MHz

14.50KB

512B

digispark-pro32

Digispark Pro (32 byte buffer)

No

ATTINY167

16MHz

14.50KB

512B

digispark-pro64

Digispark Pro (16 MHz) (64 byte buffer)

No

ATTINY167

16MHz

14.50KB

512B

digispark-tiny

Digispark USB

No

ATTINY85

16MHz

5.87KB

512B

Dwengo

ID

Name

Debug

MCU

Frequency

Flash

RAM

dwenguino

Dwenguino

No

AT90USB646

16MHz

60KB

2KB

Elektor

ID

Name

Debug

MCU

Frequency

Flash

RAM

elektor_uno_r4

Elektor Uno R4

No

ATMEGA328PB

16MHz

31.50KB

2KB

Engduino

ID

Name

Debug

MCU

Frequency

Flash

RAM

engduinov3

Engduino 3

No

ATMEGA32U4

8MHz

28KB

2.50KB

EnviroDIY

ID

Name

Debug

MCU

Frequency

Flash

RAM

mayfly

EnviroDIY Mayfly

No

ATMEGA1284P

8MHz

127KB

16KB

Generic ATTiny

ID

Name

Debug

MCU

Frequency

Flash

RAM

attiny13

Generic ATTiny13

No

ATTINY13

9MHz

1KB

64B

attiny1634

Generic ATTiny1634

No

ATTINY1634

8MHz

16KB

1KB

attiny167

Generic ATTiny167

No

ATTINY167

8MHz

16KB

512B

attiny2313

Generic ATTiny2313

No

ATTINY2313

8MHz

2KB

128B

attiny24

Generic ATTiny24

No

ATTINY24

8MHz

2KB

128B

attiny25

Generic ATTiny25

No

ATTINY25

8MHz

2KB

128B

attiny261

Generic ATTiny261

No

ATTINY261

8MHz

2KB

128B

attiny4313

Generic ATTiny4313

No

ATTINY4313

8MHz

4KB

256B

attiny44

Generic ATTiny44

No

ATTINY44

8MHz

4KB

256B

attiny441

Generic ATTiny441

No

ATTINY441

8MHz

4KB

256B

attiny45

Generic ATTiny45

No

ATTINY45

8MHz

4KB

256B

attiny461

Generic ATTiny461

No

ATTINY461

8MHz

4KB

256B

attiny48

Generic ATTiny48

No

ATTINY48

8MHz

4KB

256B

attiny84

Generic ATTiny84

No

ATTINY84

8MHz

8KB

512B

attiny841

Generic ATTiny841

No

ATTINY841

8MHz

8KB

512B

attiny85

Generic ATTiny85

No

ATTINY85

8MHz

8KB

512B

attiny861

Generic ATTiny861

No

ATTINY861

8MHz

8KB

512B

attiny87

Generic ATTiny87

No

ATTINY87

8MHz

8KB

512B

attiny88

Generic ATTiny88

No

ATTINY88

8MHz

8KB

512B

LightUp

ID

Name

Debug

MCU

Frequency

Flash

RAM

lightup

LightUp

No

ATMEGA32U4

8MHz

28KB

2.50KB

Linino

ID

Name

Debug

MCU

Frequency

Flash

RAM

one

Linino One

No

ATMEGA32U4

16MHz

28KB

2.50KB

LowPowerLab

ID

Name

Debug

MCU

Frequency

Flash

RAM

mightyhat

LowPowerLab MightyHat

No

ATMEGA328P

16MHz

31KB

2KB

moteino

LowPowerLab Moteino

No

ATMEGA328P

16MHz

31.50KB

2KB

moteinomega

LowPowerLab MoteinoMEGA

No

ATMEGA1284P

16MHz

127KB

16KB

Mcudude

ID

Name

Debug

MCU

Frequency

Flash

RAM

mightycore1284

MightyCore ATmega1284

No

ATMEGA1284P

16MHz

127KB

16KB

mightycore16

MightyCore ATmega16

No

ATMEGA16

16MHz

15.50KB

1KB

mightycore164

MightyCore ATmega164

No

ATMEGA164P

16MHz

15.50KB

1KB

mightycore32

MightyCore ATmega32

No

ATMEGA32

16MHz

31.50KB

2KB

mightycore324

MightyCore ATmega324

No

ATMEGA324P

16MHz

31.50KB

2KB

mightycore644

MightyCore ATmega644

No

ATMEGA644P

16MHz

63KB

4KB

mightycore8535

MightyCore ATmega8535

No

ATMEGA16

16MHz

7.50KB

512B

MediaTek Labs

ID

Name

Debug

MCU

Frequency

Flash

RAM

smart7688

LinkIt Smart 7688 Duo

No

ATMEGA32U4

8MHz

28KB

2.50KB

Microchip

ID

Name

Debug

MCU

Frequency

Flash

RAM

at90pwm216

Atmel AT90PWM216

No

AT90PWM216

16MHz

16KB

1KB

at90pwm316

Atmel AT90PWM316

No

AT90PWM316

16MHz

16KB

1KB

Microduino

ID

Name

Debug

MCU

Frequency

Flash

RAM

1284p16m

Microduino Core+ (ATmega1284P@16M,5V)

No

ATMEGA1284P

16MHz

127KB

16KB

1284p8m

Microduino Core+ (ATmega1284P@8M,3.3V)

No

ATMEGA1284P

8MHz

127KB

16KB

168pa16m

Microduino Core (Atmega168PA@16M,5V)

No

ATMEGA168P

16MHz

15.50KB

1KB

168pa8m

Microduino Core (Atmega168PA@8M,3.3V)

No

ATMEGA168P

8MHz

15.50KB

1KB

328p16m

Microduino Core (Atmega328P@16M,5V)

No

ATMEGA328P

16MHz

31.50KB

2KB

328p8m

Microduino Core (Atmega328P@8M,3.3V)

No

ATMEGA328P

8MHz

31.50KB

2KB

32u416m

Microduino Core USB (ATmega32U4@16M,5V)

No

ATMEGA32U4

16MHz

28KB

2.50KB

644pa16m

Microduino Core+ (Atmega644PA@16M,5V)

No

ATMEGA644P

16MHz

63KB

4KB

644pa8m

Microduino Core+ (Atmega644PA@8M,3.3V)

No

ATMEGA644P

8MHz

63KB

4KB

OpenEnergyMonitor

ID

Name

Debug

MCU

Frequency

Flash

RAM

emonpi

OpenEnergyMonitor emonPi

No

ATMEGA328P

16MHz

30KB

2KB

PanStamp

ID

Name

Debug

MCU

Frequency

Flash

RAM

panStampAVR

PanStamp AVR

No

ATMEGA328P

8MHz

31.50KB

2KB

Pinoccio

ID

Name

Debug

MCU

Frequency

Flash

RAM

pinoccio

Pinoccio Scout

No

ATMEGA256RFR2

16MHz

248KB

32KB

Pololu Corporation

ID

Name

Debug

MCU

Frequency

Flash

RAM

a-star32U4

Pololu A-Star 32U4

No

ATMEGA32U4

16MHz

28KB

2.50KB

Punch Through

ID

Name

Debug

MCU

Frequency

Flash

RAM

lightblue-bean

LightBlue Bean

No

ATMEGA328P

8MHz

31.50KB

2KB

lightblue-beanplus

LightBlue Bean+

No

ATMEGA328P

16MHz

31.50KB

2KB

Quirkbot

ID

Name

Debug

MCU

Frequency

Flash

RAM

quirkbot

Quirkbot

No

ATMEGA32U4

8MHz

28KB

2.50KB

RedBearLab

ID

Name

Debug

MCU

Frequency

Flash

RAM

blend

RedBearLab Blend

No

ATMEGA32U4

16MHz

28KB

2.50KB

blendmicro16

RedBearLab Blend Micro 3.3V/16MHz (overclock)

No

ATMEGA32U4

16MHz

28KB

2.50KB

blendmicro8

RedBearLab Blend Micro 3.3V/8MHz

No

ATMEGA32U4

8MHz

28KB

2.50KB

RepRap

ID

Name

Debug

MCU

Frequency

Flash

RAM

reprap_rambo

RepRap RAMBo

No

ATMEGA2560

16MHz

252KB

8KB

SODAQ

ID

Name

Debug

MCU

Frequency

Flash

RAM

sodaq_galora

SODAQ GaLoRa

No

ATMEGA1284P

8MHz

127KB

16KB

sodaq_mbili

SODAQ Mbili

No

ATMEGA1284P

8MHz

127KB

16KB

sodaq_moja

SODAQ Moja

No

ATMEGA328P

8MHz

31.50KB

2KB

sodaq_ndogo

SODAQ Ndogo

No

ATMEGA1284P

8MHz

127KB

16KB

sodaq_tatu

SODAQ Tatu

No

ATMEGA1284P

8MHz

127KB

16KB

Sanguino

ID

Name

Debug

MCU

Frequency

Flash

RAM

sanguino_atmega1284_8m

Sanguino ATmega1284p (8MHz)

No

ATMEGA1284P

8MHz

127KB

16KB

sanguino_atmega1284p

Sanguino ATmega1284p (16MHz)

No

ATMEGA1284P

16MHz

127KB

16KB

sanguino_atmega644

Sanguino ATmega644 or ATmega644A (16 MHz)

No

ATMEGA644

16MHz

63KB

4KB

sanguino_atmega644_8m

Sanguino ATmega644 or ATmega644A (8 MHz)

No

ATMEGA644

8MHz

63KB

4KB

sanguino_atmega644p

Sanguino ATmega644P or ATmega644PA (16 MHz)

No

ATMEGA644P

16MHz

63KB

4KB

sanguino_atmega644p_8m

Sanguino ATmega644P or ATmega644PA (8 MHz)

No

ATMEGA644P

8MHz

63KB

4KB

SeeedStudio

ID

Name

Debug

MCU

Frequency

Flash

RAM

seeeduino

Seeeduino

No

ATMEGA328P

16MHz

31.50KB

2KB

SparkFun

ID

Name

Debug

MCU

Frequency

Flash

RAM

sparkfun_digitalsandbox

SparkFun Digital Sandbox

No

ATMEGA328P

8MHz

31.50KB

2KB

sparkfun_fiov3

SparkFun Fio V3 3.3V/8MHz

No

ATMEGA32U4

8MHz

28KB

2.50KB

sparkfun_makeymakey

SparkFun Makey Makey

No

ATMEGA32U4

16MHz

28KB

2.50KB

sparkfun_megamini

SparkFun Mega Pro Mini 3.3V

No

ATMEGA2560

8MHz

252KB

8KB

sparkfun_megapro16MHz

SparkFun Mega Pro 5V/16MHz

No

ATMEGA2560

16MHz

248KB

8KB

sparkfun_megapro8MHz

SparkFun Mega Pro 3.3V/8MHz

No

ATMEGA2560

8MHz

252KB

8KB

sparkfun_promicro16

SparkFun Pro Micro 5V/16MHz

No

ATMEGA32U4

16MHz

28KB

2.50KB

sparkfun_promicro8

SparkFun Pro Micro 3.3V/8MHz

No

ATMEGA32U4

8MHz

28KB

2.50KB

sparkfun_qduinomini

SparkFun Qduino Mini

No

ATMEGA32U4

8MHz

28KB

2.50KB

sparkfun_redboard

SparkFun RedBoard

No

ATMEGA328P

16MHz

31.50KB

2KB

sparkfun_satmega128rfa1

SparkFun ATmega128RFA1 Dev Board

No

ATMEGA128RFA1

16MHz

16KB

124KB

sparkfun_serial7seg

SparkFun Serial 7-Segment Display

No

ATMEGA328P

8MHz

31.50KB

2KB

uview

SparkFun MicroView

No

ATMEGA328P

16MHz

31.50KB

2KB

SpellFoundry

ID

Name

Debug

MCU

Frequency

Flash

RAM

sleepypi

SpellFoundry Sleepy Pi 2

No

ATMEGA328P

8MHz

30KB

2KB

The Things Network

ID

Name

Debug

MCU

Frequency

Flash

RAM

the_things_uno

The Things Uno

No

ATMEGA32U4

16MHz

28KB

2.50KB

TinyCircuits

ID

Name

Debug

MCU

Frequency

Flash

RAM

tinyduino

TinyCircuits TinyDuino Processor Board

No

ATMEGA328P

8MHz

30KB

2KB

tinylily

TinyCircuits TinyLily Mini Processor

No

ATMEGA328P

8MHz

30KB

2KB

Wicked Device

ID

Name

Debug

MCU

Frequency

Flash

RAM

wildfirev2

Wicked Device WildFire V2

No

ATMEGA1284P

16MHz

120.00KB

16KB

wildfirev3

Wicked Device WildFire V3

No

ATMEGA1284P

16MHz

127KB

16KB

makerlab.mx

ID

Name

Debug

MCU

Frequency

Flash

RAM

altair

Altair

No

ATMEGA256RFR2

16MHz

248KB

32KB

nicai-systems

ID

Name

Debug

MCU

Frequency

Flash

RAM

bob3

nicai-systems BOB3 coding bot

No

ATMEGA88

8MHz

8KB

1KB

nibo2

nicai-systems NIBO 2 robot

No

ATMEGA128

16MHz

128KB

4KB

nibobee

nicai-systems NIBObee robot

No

ATMEGA16

15MHz

16KB

1KB

nibobee_1284

nicai-systems NIBObee robot with Tuning Kit

No

ATMEGA1284P

20MHz

128KB

16KB

niboburger

nicai-systems NIBO burger robot

No

ATMEGA16

15MHz

16KB

1KB

niboburger_1284

nicai-systems NIBO burger robot with Tuning Kit

No

ATMEGA1284P

20MHz

128KB

16KB

ubIQio

ID

Name

Debug

MCU

Frequency

Flash

RAM

ardhat

ubIQio Ardhat

No

ATMEGA328P

16MHz

31.50KB

2KB