https://registry.platformio.org/platforms/platformio/atmelmegaavr
platform = atmelmegaavr
8-bit MCUs Built for Real-time Control with Core Independent Peripherals combining intelligent hardware peripherals along with the low-power capability of an AVR core, megaAVR microcontrollers (MCUs) broaden the effectiveness of your real-time control systems.
For more detailed information please visit vendor site.
In the case of external programmers, it’s easy to brick a board simply by specifying incorrect upload flags. It’s highly recommended to use the upload_command option that gives the full control over flags used for uploading. Please read Upload using Programmer for more information.
pymcuprog
is a Python-based CLI tool for programming AVR devices with UPDI interface
using either a Microchip debugger (Atmel-ICE, Power Debugger, PICkit4, Snap, PKOB nano /
nEDBG / Curiosity Nano debugger) or via a standard serial port. It can be installed
directly in the PlatformIO virtual environment using the following command:
pip install pymcuprog
Once pymcuprog
is installed it can be used as the uploader via a custom
upload_command option, for example:
[env:ATmega3209_pymcuprog_upload]
platform = atmelmegaavr
framework = arduino
board = ATmega3209
upload_speed = 115200
upload_flags =
--tool
uart
--device
atmega3209
--uart
$UPLOAD_PORT
--clk
$UPLOAD_SPEED
upload_command = pymcuprog write --erase $UPLOAD_FLAGS --filename $SOURCE
Note
When using a Microchip debugger it must be specified in the –tool argument, and the –uart argument omitted.
More information and a typical circuit diagram can be found in the official pymcuprog repository.
pymcuprog
is maintained by Microchip, and published on GitHub and pypi.org.
pyupdi
is a Python-based tool for programming tinyAVR and megaAVR devices with UPDI
interface via a standard serial port. It can be installed directly in the PlatformIO
virtual environment using the following command:
pip install https://github.com/mraardvark/pyupdi/archive/master.zip
Once pyupdi
is installed it can be used as the uploader via a custom
upload_command option, for example:
[env:ATmega3209_pyupdi_upload]
platform = atmelmegaavr
framework = arduino
board = ATmega3209
upload_speed = 115200
upload_flags =
-d
mega3209
-c
$UPLOAD_PORT
-b
$UPLOAD_SPEED
upload_command = pyupdi $UPLOAD_FLAGS -f $SOURCE
Warning
Device names used in in pyupdi
differ from MCU names used in the atmelmegaavr
platform. Run pyupdi --help
to see the list of supported devices.
More information and a typical circuit diagram can be found in the official pyupdi repository repository.
PlatformIO has a built-in target called fuses
for setting fuse bits. The default fuse
bits are predefined in the board manifest file in the fuses
section. For example,
fuses section for Arduino Nano Every board.
To set fuse bits you need to use target fuses
with pio run --target
command.
Custom fuse values and upload flags (based on upload protocol) should be specified in
“platformio.ini” (Project Configuration File). An example of setting custom fuses for ATmega3209
board:
[env:custom_fuses]
platform = atmelmegaavr
framework = arduino
board = ATmega3209
upload_protocol = xplainedmini_updi
board_fuses.bootend = 0xAA
board_fuses.syscfg0 = 0xBB
board_fuses.osccfg = 0xCC
For more detailed information read Overriding default fuses command.
PlatformIO has a built-in target called bootloader
for flashing bootloaders. The
default bootloader image and corresponding fuse bits are predefined in the board manifest
file in the bootloader
section, for example, Arduino Uno WiFi Rev2.
To upload a bootloader image you need to use target bootloader
with
pio run --target
command.
Custom bootloader and accompanying fuses should be specified in “platformio.ini” (Project Configuration File).
An example of setting custom bootloader for ATmega4808
board:
[env:ATmega4808]
platform = atmelmegaavr
framework = arduino
board = ATmega4808
board_bootloader.file = /path/to/custom/bootloader.hex
board_bootloader.bootend = 0xFF
board_bootloader.syscfg0 = 0xDE
board_bootloader.osccfg = 0xFD
board_bootloader.lock_bits = 0x0F
For more detailed information read Overriding default bootloader command.
Examples are listed from Atmel megaAVR development platform repository:
You can switch between stable releases of Atmel megaAVR development platform and the latest upstream version using platform option in “platformio.ini” (Project Configuration File) as described below.
; Latest stable version
[env:latest_stable]
platform = atmelmegaavr
board = ...
; Custom stable version
[env:custom_stable]
platform = atmelmegaavr@x.y.z
board = ...
[env:upstream_develop]
platform = https://github.com/platformio/platform-atmelmegaavr.git
board = ...
Name |
Description |
---|---|
Arduino Wiring-based Framework for Microchip megaAVR microcontrollers |
|
Arduino Wiring-based Framework for Microchip megaAVR microcontrollers (MegaCoreX) |
|
Arduino Wiring-based Framework for Microchip tinyAVR 0-series and 1-series chips (megaTinyCore) |
|
AVRDUDE is a utility to download/upload/manipulate the ROM and EEPROM contents of megaAVR microcontrollers |
|
GCC Toolchain for Microchip AVR microcontrollers |
Warning
Linux Users:
Install “udev” rules 99-platformio-udev.rules
Raspberry Pi users, please read this article Enable serial port on Raspberry Pi.
Windows Users:
Please check that you have a correctly installed USB driver from board manufacturer
Name |
Description |
---|---|
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 |
Note
You can list pre-configured boards by pio boards command
For more detailed board
information please scroll the tables below by
horizontally.
Name |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|
No |
ATMEGA4809 |
16MHz |
47.50KB |
6KB |
|
No |
ATMEGA4809 |
16MHz |
47.50KB |
6KB |
Name |
Debug |
MCU |
Frequency |
Flash |
RAM |
---|---|---|---|---|---|
No |
ATMEGA1608 |
16MHz |
16KB |
2KB |
|
No |
ATMEGA1609 |
16MHz |
16KB |
2KB |
|
No |
ATMEGA3208 |
16MHz |
32KB |
4KB |
|
No |
ATMEGA3209 |
16MHz |
32KB |
4KB |
|
No |
ATMEGA4808 |
16MHz |
48KB |
6KB |
|
No |
ATMEGA4809 |
16MHz |
48KB |
6KB |
|
No |
ATMEGA808 |
16MHz |
8KB |
1KB |
|
No |
ATMEGA809 |
16MHz |
8KB |
1KB |
|
No |
ATTINY1604 |
16MHz |
16KB |
1KB |
|
No |
ATTINY1606 |
16MHz |
16KB |
1KB |
|
No |
ATTINY1607 |
16MHz |
16KB |
1KB |
|
No |
ATTINY1614 |
16MHz |
16KB |
2KB |
|
No |
ATTINY1616 |
16MHz |
16KB |
2KB |
|
No |
ATTINY1617 |
16MHz |
16KB |
2KB |
|
No |
ATTINY202 |
16MHz |
2KB |
128B |
|
No |
ATTINY204 |
16MHz |
2KB |
128B |
|
No |
ATTINY212 |
16MHz |
2KB |
128B |
|
No |
ATTINY214 |
16MHz |
2KB |
128B |
|
No |
ATTINY3216 |
16MHz |
32KB |
2KB |
|
No |
ATTINY3217 |
16MHz |
32KB |
2KB |
|
No |
ATTINY402 |
16MHz |
4KB |
256B |
|
No |
ATTINY404 |
16MHz |
4KB |
256B |
|
No |
ATTINY406 |
16MHz |
4KB |
256B |
|
No |
ATTINY412 |
16MHz |
4KB |
256B |
|
No |
ATTINY414 |
16MHz |
4KB |
256B |
|
No |
ATTINY416 |
16MHz |
4KB |
256B |
|
No |
ATTINY417 |
16MHz |
4KB |
256B |
|
No |
ATTINY804 |
16MHz |
8KB |
512B |
|
No |
ATTINY806 |
16MHz |
8KB |
512B |
|
No |
ATTINY807 |
16MHz |
8KB |
512B |
|
No |
ATTINY814 |
16MHz |
8KB |
512B |
|
No |
ATTINY816 |
16MHz |
8KB |
512B |
|
No |
ATTINY817 |
16MHz |
8KB |
512B |
|
No |
ATMEGA4808 |
16MHz |
48KB |
6KB |
|
No |
ATMEGA4809 |
16MHz |
48KB |
6KB |
|
No |
ATMEGA4809 |
16MHz |
48KB |
6KB |