Skip to main content

Programming Tool for classic AVR Microcontrollers with USBasp or USBtinyISP

Description

With this tool, classic AVR microcontrollers can be flashed via ISP with a USBasp or a USBtinyISP programmer. The programmer type and the connected chip are detected automatically. BIN and Intel HEX files are supported; fuses and lock bits can be written, and fuse settings that would disable ISP (RSTDISBL, DWEN, SPIEN) are refused unless forced.

The tool is a Python port of the relevant parts of avrdude 8.3; the part data was generated from avrdude.conf. It supports all 168 classic AVRs of avrdude.conf with ISP and paged flash, among others:

  • ATtiny13(A), ATtiny24(A)/44(A)/84(A), ATtiny25/45/85, ATtiny26, ATtiny43U, ATtiny48/88, ATtiny87/167, ATtiny261(A)/461(A)/861(A), ATtiny441/841, ATtiny828(R), ATtiny1634(R), ATtiny2313(A)/4313
  • ATmega8(A), ATmega16(A), ATmega32(A), ATmega64(A), ATmega128(A), ATmega162, ATmega163, ATmega8515, ATmega8535
  • ATmega48/88/168/328 (A, P, PA, PB), ATmega164/324/644 (A, P, PA, PB), ATmega1284(P)
  • ATmega165/169/325/329/3250/3290/645/649/6450/6490 (A, P, PA)
  • ATmega640/1280/1281/2560/2561, ATmega128RFA1, ATmega64/128/256RFR2, ATmega644/1284/2564RFR2
  • ATmega8U2/16U2/32U2, ATmega16U4/32U4, AT90USB82/162/646/647/1286/1287
  • ATmega16M1/32M1/64M1, ATmega32C1/64C1, AT90CAN32/64/128, AT90PWM1/2(B)/3(B)/81/161/216/316
  • ATmega16HVB/32HVB, ATmega32HVE2/64HVE2, ATmegaS64M1/S128, ATA5505, ATA6612C/6613C/6614Q/6616C/6617C, ATA664251

Use avrprog --list to show all supported chips.

Preparations

Linux users need permission to access the device. Run:

echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="16c0", ATTR{idProduct}=="05dc", MODE="666"' | sudo tee /etc/udev/rules.d/99-avrprog.rules
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="1781", ATTR{idProduct}=="0c9f", MODE="666"' | sudo tee -a /etc/udev/rules.d/99-avrprog.rules
sudo udevadm control --reload-rules

On Windows, the programmer needs a libusb compatible driver (WinUSB, libusb-win32 or libusbK, installable with Zadig). The libusb backend is installed automatically with the package (libusb-package).

Installation

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

pip install avrprog

Usage

Connect the programmer to your PC and its ISP cable to the AVR.

Usage: avrprog [-h] [-t {usbasp,usbtiny}] [-p PART] [-B BITCLOCK] [-e] [-f FLASH] [-l LFUSE] [-H HFUSE] [-E EFUSE] [-L LOCK] [-r] [-F] [--list]

Optional arguments:
  -h, --help                show help message and exit
  -t, --programmer          programmer type (default: auto-detect)
  -p, --part                chip type, e.g. m328p (default: auto-detect by signature)
  -B, --bitclock            ISP clock: period in us (e.g. 10) or frequency (e.g. 125kHz)
  -e, --erase               perform a chip erase (implied with -f)
  -f FLASH, --flash FLASH   write BIN or HEX file to flash and verify
  -l, --lfuse VALUE         write low fuse byte
  -H, --hfuse VALUE         write high fuse byte
  -E, --efuse VALUE         write extended fuse byte
  -L, --lock VALUE          write lock byte (after all other actions)
  -r, --read                read and show fuses, lock bits and calibration
  -F, --force               allow fuse settings that disable ISP (RSTDISBL, DWEN, SPIEN)
  --list                    list supported chips
Without action arguments the tool shows programmer, chip and fuses.

Example:
avrprog -f firmware.hex -l 0xe2 -H 0xdf -E 0xff

License

GNU General Public License v2.0 or later (derived from avrdude).

Metadata

Release files for avrprog 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 avrprog 1.1.0
File Size Uploaded Provenance Actions
avrprog-1.1.0.tar.gz 35.1 kB Without provenance Details for avrprog-1.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 67.6 kB

Release files / avrprog-1.1.0.tar.gz

Download URL avrprog-1.1.0.tar.gz
Size 35.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2db5bab3e85f24ef9d19a08d4436202435c767f8a6bc3f9b7187bc01104a46bc
BLAKE2b-256 checksum
How to use checksums
52628b360eaa40068ee9441d686e019150f729030525359af531830287967675
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

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

Download URL avrprog-1.1.0-py3-none-any.whl
Size 32.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5cf8f5db94d834fe1de5c2de845fd8a7ac0823c55fc1f2a93351bf31a4f8e1fb
BLAKE2b-256 checksum
How to use checksums
a2c6c404e3c3ae05be2224e7ed50c610fe8fe7f4179ae820d399ae69e57eb200
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for avrprog 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