Skip to main content

Simple SerialUPDI Programming Tool for all AVR Microcontrollers with UPDI

Description

megaUPDI allows all AVR microcontrollers with UPDI programming interface (tinyAVR 0/1/2, megaAVR 0, AVR DA/DB/DD/DU/EA/EB/EC/LA/SD) to be programmed using a USB-to-serial converter connected in a special way to the UPDI pin (also called SerialUPDI). More information can be found here. megaUPDI is the big brother of TinyUPDI: the NVM controller variant (P:0, P:2 ... P:6) is read from the System Information Block (SIB) of the target, the device is identified by its signature.

Supported microcontrollers (133 devices):

  • tinyAVR 0-series: ATtiny202, 204, 402, 404, 406, 804, 806, 807, 1604, 1606, 1607
  • tinyAVR 1-series: ATtiny212, 214, 412, 414, 416, 416auto, 417, 814, 816, 817, 1614, 1616, 1617, 3216, 3217
  • tinyAVR 2-series: ATtiny424, 426, 427, 824, 826, 827, 1624, 1626, 1627, 3224, 3226, 3227
  • megaAVR 0-series: ATmega808, 809, 1608, 1609, 3208, 3209, 4808, 4809
  • AVR DA: AVR32DA28/32/48, AVR64DA28/32/48/64, AVR128DA28/32/48/64 (also DA-S variants, e.g. AVR128DA28S)
  • AVR DB: AVR32DB28/32/48, AVR64DB28/32/48/64, AVR128DB28/32/48/64
  • AVR DD: AVR16DD14/20/28/32, AVR32DD14/20/28/32, AVR64DD14/20/28/32
  • AVR DU: AVR16DU14/20/28/32, AVR32DU14/20/28/32, AVR64DU28/32
  • AVR EA: AVR8EA28/32, AVR16EA28/32/48, AVR32EA28/32/48, AVR64EA28/32/48
  • AVR EB: AVR16EB14/20/28/32, AVR32EB14/20/28/32
  • AVR EC: AVR64EC28/48
  • AVR LA: AVR16LA14/20/28/32, AVR32LA14/20/28/32
  • AVR SD: AVR32SD20/28/32

Preparations

If necessary, a driver for the USB-to-serial converter used must be installed.

Installation

Ensure that the prerequisites for installing Python packages are met. Then execute the following command in the command line:

pip install megaupdi

Usage

Connect the USB-to-serial converter via USB to the PC and via the circuit described below to the UPDI pin of the microcontroller.

USB2SERIAL                         AVR
+--------+                    +-----------+
|     RXD| <------------+---> |UPDI       |
|        |              |     |           |
|     TXD| ---|1kOhm|---+     |           |
|        |                    |           |
|     VDD| -----------------> |VDD        |
|     GND| -----------------> |GND        |
+--------+                    +-----------+

Alternatively, a pre-assembled SerialUPDI programmer can be used.

Usage: megaupdi [-h] [-p PORT] [-d DEVICE] [-e] [-f FLASH] [-fs [FUSES ...]] [-t TRIM] [-l]

Optional arguments:
  -h, --help                show help message and exit
  -p PORT, --port PORT      serial port (if not set, it will be auto-detected)
  -d, --device              set target device (if not set, it will be auto-detected)
  -e, --erase               perform a chip erase (implied with --flash)
  -f FLASH, --flash FLASH   BIN file to flash
  -fs [FUSES ...], --fuses [FUSES ...]
                            fuses to set (syntax: fuse_nr:0xvalue)
  -t TRIM, --trim TRIM      configure oscillator for given frequency (set fuse 2)
  -l, --list                list supported devices
Examples:
megaupdi -f firmware.bin
megaupdi -d avr128da28 -f firmware.bin -fs 0:0x00 1:0x00
megaupdi -f firmware.bin -fs 6:0x04 7:0x00 8:0x00 -t 8000000

Without action arguments, megaupdi shows the device and its fuses.

Notes:

  • Fuse numbers are relative to the first fuse (FUSE0). Valid numbers depend on the device family: tinyAVR/megaAVR 0: 0 - 10 (10 = LOCKBIT), AVR Dx/Ex/Lx/Sx: e.g. 0, 1, 2, 5, 6, 7, 8 (plus 10 on some families). Invalid fuse numbers are rejected before anything is erased or written.
  • -t sets the oscillator fuse (16 or 20 MHz) on tinyAVR, megaAVR 0, AVR EA/EB and AVR LA. The system frequency must be reachable with the clock prescaler, which has to be set by the firmware.
  • A locked device is only unlocked (by a chip erase) when -e or -f is given.
  • Changing the pin configuration fuse can disable the UPDI pin (tinyAVR: fuse 5, AVR DD/DU/EA/EB/EC: fuse 5, AVR LA: fuse 3); the device can then only be programmed with a high-voltage programmer. megaUPDI prints a warning in this case.
  • Only flash and fuses can be programmed. EEPROM, user row, boot row and the lock bits of the AVR Dx/Ex/Lx/Sx families are not supported.

Metadata

Release files for megaupdi 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for megaupdi 1.1.0
File Size Uploaded Provenance Actions
megaupdi-1.1.0.tar.gz 16.6 kB Without provenance Details for megaupdi-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for megaupdi 1.1.0
File Interpreter ABI Platform Actions
megaupdi-1.1.0-py3-none-any.whl Python 3 none any Details for megaupdi-1.1.0-py3-none-any.whl

Total release size: 31.3 kB

Release files / megaupdi-1.1.0.tar.gz

Download URL megaupdi-1.1.0.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ce0a01a8cebd57c16b50dd4b840f6ddfee3143eb7132977c362666ae007630b2
BLAKE2b-256 checksum
How to use checksums
c46c6ae6fef80f50a39d85d16c47deebdabafd9b73a55a1286bb323d875ba474
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / megaupdi-1.1.0-py3-none-any.whl

Download URL megaupdi-1.1.0-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4bf2fca55fa91631ee8bb8fd159655854b4ba7c66902c0c0c543e2a3007d2607
BLAKE2b-256 checksum
How to use checksums
49f3658eaf7f1c934074ca29a61afdd2c37b94d15246ea9270d348d90f882f2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for megaupdi 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page