Story
Why I made SafeASP
The USBasp is the cheapest and most popular AVR programmer, and I have shared two versions of it here before: v4 (USB-B, 2018) and v5 (micro-USB, 2019). Both work, but they share the same weak points as most USBasp clones:
- the ISP lines always drive 5 V, even when the jumper is set to 3.3 V, so a 3.3 V or 1.8 V chip gets 5 V on MOSI, SCK and RST;
- the target supply has no current limit, so a shorted target resets the programmer or the PC's USB port;
- old USB connectors (USB-B, micro-USB) and only a 6-pin header in a row.
SafeASP (USBasp V6) fixes all of that while keeping the cheap ATmega8A and the original USBasp firmware, unchanged, so it still works with avrdude and the Arduino IDE out of the box.
Features
- USB-C (16-pin USB 2.0 receptacle) with a separate 5.1 k pull-down on CC1 and CC2, so it powers up from USB-C to USB-C cables, laptops and chargers.
- Safe for 1.8 V, 3.3 V and 5 V targets: a 74LVC8T245 drives MOSI, SCK and RST, and a 74LVC1T45 brings MISO back. The target side of both runs from the target's own VCC (ISP pin 2), so the signals always match the target voltage.
- Pins released when idle: the level shifter is only enabled while the red BUSY LED is on. That is the PC1 line the USBasp firmware already drives low during programming, so no firmware change is needed and the programmer never fights the target's own use of its SPI pins.
- Protected target power: jumper JP1 selects 5 V, 3.3 V (AP2112K LDO) or off, with a 200 mA resettable fuse and a yellow "TGT PWR" LED.
- USB protection: 500 mA resettable fuse on VBUS and a USBLC6-2SC6 ESD array on D+ / D-.
- Both ISP connectors: keyed 2x5 box header (standard 10-pin AVR cable) and 2x3 header (6-pin / Arduino ICSP).
- Slow-SCK jumper (JP2) for chips still running from their 1 MHz factory clock.
- Easy firmware update: a separate 6-pin header (J4) to flash the board's own ATmega8A with another programmer.
- Labelled silkscreen: every LED and every ISP / jumper pin is named on the board.
How it works
USB-C -> ESD + fuse -> V-USB interface (68 R series resistors, 3.6 V zeners, 2.2 k D- pull-up) -> ATmega8A at 12 MHz, 5 V running the USBasp firmware -> level shifter (5 V side from the MCU, target side from VTGT) -> 10-pin and 6-pin ISP headers.
- PB0 (12): USB D-
- PB1 (13) + PD2/INT0 (32): USB D+
- PB2 / PB3 / PB4 / PB5 (14-17): RST / MOSI / MISO / SCK, through the level shifter
- PC0 (23): green LED, USB ready
- PC1 (24): red LED + level-shifter enable (BUSY_N)
- PC2 (25): slow-SCK jumper JP2
These are exactly the pins the USBasp 2011-05-28 firmware uses (checked in its source: usbasp.h, isp.h, usbconfig.h, main.c).
Using it
- Plug in USB-C: the green USB LED comes on.
- Set JP1: 1-2 = send 5 V to the target, 2-3 = 3.3 V, no jumper = target has its own supply (never fit JP1 on a self-powered target).
- Connect the 10-pin or 6-pin cable (pin 1 to pin 1).
- Program: avrdude -c usbasp -p m328p -U flash:w:firmware.hex:i or, in the Arduino IDE, Tools > Programmer > USBasp, then Upload Using Programmer / Burn Bootloader.
Firmware
SafeASP uses the official USBasp firmware by Thomas Fischl (2011-05-28) without changes. Fuses for the ATmega8A with a 12 MHz crystal: high 0xC9, low 0xEF. A new board is flashed once through J4 with any working programmer (another USBasp or an Arduino running ArduinoISP). Full steps are in the repository.
Board
- 2 layers, 84 x 32 mm, 1.6 mm FR-4, 2 M3 mounting holes
- 45 parts, mostly 1206 / 0805 passives, TQFP-32, TSSOP-24, SOT-23-6, SC-88 and SOT-25
- 0.5 mm power tracks, GND copper on both layers, design rule check clean
Status
Schematic and PCB are finished and checked. The first boards are not built or tested yet; I will add photos and test results (3.3 V and 5 V targets, USB-C to USB-C cable) once they arrive.
Open source
Hardware and documentation: CC BY-SA 4.0. Full design notes, interactive BOM / wiring / schematic / PCB pages and the firmware guide: https://github.com/ElectroIoT/SafeASP
Credits: USBasp firmware and the original circuit by Thomas Fischl (GPL-2.0), built on V-USB by OBJECTIVE DEVELOPMENT.






