Post date: Dec 09, 2016 2:48:26 AM
The idea for this project came from https://learn.adafruit.com/usbtinyisp. I've customized it a bit to suit my needs.
Like the original, this one is powered by the Atmel attiny2313. This MCU has only 128 bytes of SRAM and 2Kb of flash storage.
I trimmed down the original design in order to fit it into a USB stick project box. The original circuit looked like this:
I removed R4, R5, R6, R7, R10, C1, and all of the jumpers. Keeping only the diodes and resistors for signal level conversion from TTL 5V to USB 3V, and the crystal and capacitors for the clock.
This circuit might even work without the USB signal level conversion and capacitors on the clock, but I had plenty of room on the perfboard.
Here is a pic of the circuit breadboarded, testing programming an attiny85:
I used an Arduino running ISP sketch to flash the firmware to the attiny2313 (your paths and comp ports may differ):
/cygdrive/c/Program\ Files\ \(x86\)/Arduino/hardware/tools/avr/bin/avrdude.exe -c avrisp -p attiny2313 -P COM5 -b 19200 -C 'c:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf' -U flash:w:main.hex
Don't forget to set fuse bits after putting firmware in flash on the attiny2313
/cygdrive/c/Program\ Files\ \(x86\)/Arduino/hardware/tools/avr/bin/avrdude.exe -c avrisp -p attiny2313 -P COM5 -b 19200 -C 'c:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf' -U hfuse:w:0xdf:m -U lfuse:w:0xef:m
For this project, I bought an empty USB project shell, and used a rotary tool freehand to shape the perfboard to fit the case:
I took the circuit from breadboard to the shaped perfboard. The 6 pin header will stick out of the case to provide connection to target AVR to be programmed.
I built a target board to plug in to the USB stick, with a 28-pin ZIF socket. Three 6-pin headers, one for programming attiny85, one for programming attiny2313, and one for programming atmega328p.
Programming an attiny85, the red light indicates access to the target AVR, the green light indicates USB connection:
$ /cygdrive/c/Program\ Files\ \(x86\)/Arduino/hardware/tools/avr/bin/avrdude.exe -c usbtiny -p attiny85 -b 19200 -C 'c:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.conf' -t
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude.exe: Device signature = 0x1e930b
avrdude> q
>>> q
avrdude.exe done. Thank you.
Helpful documentation and links below.
Drivers, schematic, and firmware from the original project this one is based on: https://learn.adafruit.com/usbtinyisp/download (v1.0)