VUSBtiny is a small in-system programmer (ISP) for Atmel AVR microcontrollers. It allows you to program microcontrollers on the go, without carrying a big programmer with you.
VUSBtiny is based on the USBtinyISP. It uses an Atmel AVR microcontroller running V-USB, which allows it to communicate with your computer via a USB port.
The programmer was not developed by me, but with this repository I added to it in some ways:
avr-gcc
You can find the original VUSBtiny page here (or here).
VUSBtiny is licensed under GNU GPL v2.0. The license is in the file LICENSE.txt
. The changes I made are released under the same license.
The V-USB driver is licensed under GNU GPL v2.0. If you intend to use V-USB commercially read this page.
To assemble your own VUSBtiny you will need the following components:
The following instructions teach you how you can flash the Atmel AVR you chose to be the brain of your VUSBtiny. I will assume you are using ATtiny45 or ATtiny85. The instructions should be very similar even if you are using others.
makefile
:
MCU=attiny85
, for examplePROGRAMMER_MCU
also. For ATtiny85/45 this is not neededAVRDUDE_PROGRAMMERID=avrisp
AVRDUDE_PORT=/dev/ttyACM0
or to whatever port the Arduino Uno is connected to. You check which port to use by running dmesg
right after you connect your Arduino. The last lines in the output should mention some tty
portBAUD=19200
. This value must match the one in the Serial.begin()
in the "ArduinoISP" exampleFUSE_L
and FUSE_H
)make
. The source should compile successfullymake install
makefile
is prepared for ATtiny85/45. If you have another MCU search for a fuse calculator that can aid you setting the correct fusesmake fuse
Your newly made programmer will be seen as a USBtinyISP programmer. That means the options you give to avrdude
will be the same as if you had a true USBtinyISP connected. Example (flashing a simple blink code):
avrdude -c usbtiny -p t85 -U flash:w:blinkC.hex
You may have to run with sudo
, or set correct options in your system.
Checking if your device was recognised
Little after you connect the VUSBtiny to your computer if you run dmesg
you should see something like this:
[27548.612082] usb 4-1.5: new low-speed USB device number 105 using ehci-pci
[27548.639576] usb 4-1.5: New USB device found, idVendor=1781, idProduct=0c9f
[27548.639587] usb 4-1.5: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[27548.639592] usb 4-1.5: Product: USBtinyISP
If instead you see only error messages this means the VUSBtiny was not correctly recognised, so it will not work. Try reconnecting.
When programming with VUSBtiny avrdude
throws Operation not permitted
error
avrdude -c usbtiny -p t85 -U flash:w:blinkC.hex
avrdude: error: usbtiny_transmit: error sending control message: Operation not permitted
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: error: usbtiny_transmit: error sending control message: Operation not permitted
avrdude done. Thank you.
If you see avrdude
throwing the previous error back atcha it is probably a permissions problem and you have two options:
sudo
orWhen programming with VUSBtiny avrdude
throws initialization failed, rc=-1
error
avrdude -c usbtiny -p t85 -U flash:w:blinkC.hex
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
If you see this error you probably made a mistake when hooking up the programmer (VUSBtiny) to the target (whatever microcontroller you are programming). Recheck your connections against a 6-pin ISP header pinout and the MISO, MOSI, SCK, RST, VCC and GND pins of your microcontroller.
Some improvements that should be made to the PCB are:
leave more space between the capacitor and the ISP headers. This way the capacitor can be bent to be made horizontal without difficulting access to the ISP header pins
increase spacing between traces. This is meant to ease manual production and soldering of the board