Summary of USBTiny-MkII SLIM programmer
This article describes the USBTiny-MkII SLIM programmer, an AVRISP-MKII clone supporting Attiny, Atmega, and Xmega microcontrollers via ISP, PDI, and TPI interfaces. Compatible with AvrStudio and AvrDude, it features an AT90USB162 controller for high-speed programming, a voltage translator, selectable 3.3V/5V power, and status LEDs. The device uses MAX3002 or GTL2003 chips depending on the PCB version and includes IDC sockets for various protocols.
Parts used in the USBTiny-MkII SLIM Programmer:
- AT90USB162 controller
- MAX3002 or GTL2003 voltage translator
- LDO MCP1825S-3302ED stabilizer
- IDC 6pin sockets (three units)
- Status LEDs
- Voltage selection jumper
- LF33 pin-compatible stabilizer (optional)
What a USBtiny programmer actually is
USBtiny is a software USB stack written by Dick Streefland for AVR microcontrollers with no USB peripheral, and USBtinyISP is the board built around it: an ATtiny2313 on a 12 MHz crystal, an ISP header, and on most versions a 74AHC125 buffer. No bridge chip, no USB-capable MCU — the core that answers the host also clocks the target’s SPI bus. The stack costs about 1250 to 1350 bytes of flash and 46 bytes of RAM.
Low-speed USB runs at 1.5 Mbit/s, so at 12 MHz each bit lasts exactly eight instruction cycles. The firmware must catch the start of packet, recover timing from the sync pattern, undo NRZI coding and bit stuffing, and reply inside the response window.
- Fixed clock rates. V-USB requires exactly 12, 15, 16 or 20 MHz, or 12.8 / 16.5 MHz from a calibrated RC oscillator. A 16 MHz crystal is allowed but is not divisible by the 1.5 MHz bit rate, so the code inserts leap cycles.
- Clock accuracy. Sampling is open-loop across a packet, so drift must stay inside about a quarter bit over eleven bytes, near 0.3 % at 12 MHz. The 16.5 MHz modules tolerate about 1 %, but only parts with the 64 MHz PLL reach that rate.
- Interrupt latency. Interrupts must not stay disabled more than 25 cycles, about 2 µs, and one USB message can hold the CPU for up to 1200 cycles, about 100 µs.
- No error checking. The driver checks the PID but not the token or data CRC, not bit stuffing, not a misplaced SE0 — it must start replying within seven bit times.
So a marginal cable or a noisy clone yields wrong bytes rather than clean retries, and only avrdude’s read-back verify catches them. With 8-byte low-speed packets, throughput is about a kilobyte per second; Adafruit quotes 8 s to write and 4 s to read back an ATmega8.
The ISP side: hard limits
Everything done to the target goes over four SPI lines and RESET using the serial programming instruction set, which fixes the ceiling.
- Classic AVR with ISP and 64 KB of flash or less; the ATmega1280 and 2560 families are out.
- No TPI parts (ATtiny4/5/9/10) and no early cores such as the AT90S1200.
- No high-voltage programming: there is no 12 V source on the board, so HVSP and HVPP are unavailable in every firmware version.
- No PDI or UPDI, no debugWIRE.
The missing high-voltage mode hurts: RSTDISBL on an ATtiny85, or an external clock that is not fitted, locks ISP out, and only a 12 V programmer recovers the part.
Clock speed is where most failures live
Serial programming requires SCK at most a quarter of the target clock. avrdude’s -B sets a delay in the firmware:
SCK (kHz) = 1000 / (1.5 + B) avrdude -c usbtiny -p t85 -B 10 -U flash:w:main.hex # about 87 kHz avrdude -c usbtiny -p t85 -B 32 -U lfuse:r:-:h # about 30 kHz
-B 1 is the fast setting, 400 kHz, and expects a target of about 4 MHz or more. The default -B 10, near 87 kHz, suits anything above 500 kHz. Parts on the 1 MHz factory RC oscillator, especially the 128 kHz clock, need -B 32 or slower; the slowest useful setting is about 3.9 kHz. Adafruit notes these speeds are emulated with delay loops, not divided from a real clock.
Drivers and identification
- Linux: nothing to install when avrdude is built with libusb. Failures are permissions; a udev rule for
1781:0c9fclears them. - macOS: no driver or kext; avrdude reaches it through libusb.
- Windows: no inbox driver; libusb-win32 or WinUSB must be bound to it, which is what Zadig or the vendor installer does.
All three share VID/PID 0x1781:0xc9f and no serial number, so AVRDUDE separates multiple units by USB topology, not by ID.
Genuine implementation or copy
The identifiers are public and cloned verbatim, so a successful lsusb proves nothing. What differs is around the firmware:
- A 12 MHz crystal or ceramic resonator. Boards on an uncalibrated RC oscillator drift out of USB tolerance as they warm.
- The 74AHC125 buffer, which level-shifts targets from 1.8 V to 5.5 V. Cheap boards wire the ATtiny straight to the header, which works until the target is separately powered.
- A 1.5 kΩ pull-up on D− and 68 Ω series resistors on both data lines.
A behavioural check beats a visual one: read signature and fuses from a known-good chip, then program an ATtiny85 still on its 1 MHz factory clock at -B 32. Copies that reproduce the protocol but not the timing fail there.
When a different programmer is right
Use high-voltage hardware when a part is locked by fuses or you need HVSP on an 8-pin ATtiny; a PDI or UPDI tool for xmega, newer tinyAVR and anything above 64 KB; a debugger for debugWIRE. For volume work the 400 kHz ceiling is the argument: a 32 KB image takes the better part of a minute, doubled by verify, while a programmer with real USB hardware clocks the target several times faster.
What is documented here is the firmware’s constraint list, the vendor’s supported-parts table and the tool’s timing arithmetic. Nothing was measured; whether a given board honours -B or survives a separately powered target must be checked on the unit.
References
- Dick Streefland, USBtiny firmware README (clock rate, flash and RAM footprint); Objective Development, V-USB —
usbdrv/usbdrv.hfor clock rates, interrupt latency and error-checking limits, plus the V-USB notes on clock precision. - Adafruit Learning System, USBtinyISP — supported and unsupported parts, AVRDUDE
-Btimings, driver notes. - AVRDUDE project, AVRDUDE manual — the
usbtinyprogrammer, libusb requirement, absence of serial numbers.
- What microcontrollers does this programmer support?
It supports all Attiny, Atmega, and Xmega µcontrollers. - Can I use this programmer with AvrStudio?
Yes, it works with AvrStudio or AvrDude. - How do I select the target chip voltage?
Short pins 1 and 2 for 5V, or pins 2 and 3 for 3.3V using the voltage selection jumper. - What happens if I remove the voltage jumper?
Removing the jumper disconnects voltage from the translated side, requiring you to provide voltage from the target chip. - Is the MAX3002 version recommended for all users?
No, the MAX3002 version 1.0 works poorly when ISP lines are loaded with resistance or capacitance; version 1.1 with GTL2003 is better. - Can I build this programmer at home?
Yes, the PCB can be homemade because vias are not placed under chips or elements, allowing wire connections. - How is the code changed for the AT90USB162?
The code change is made through the built-in USB bootloader and the free tool from Atmel called FLIP. - What are the three programming interfaces supported?
The device supports ISP, PDI, and TPI interfaces.
