Introduction: DIY $5 USBTinyISP

Picture of DIY $5 USBTinyISP

Dear Adafruit, Sparkfun, Radioshack, and hobbyist companies of the like,

I'm a high-schooler with zero dollars in the bank. I can't really afford to buy a $60 Arduino from RS when I could buy it for $15 on ebay, from Shenzhen or Hong Kong.
I understand that I am hurting your business by not buying your products, but by doing so I educate myself and others.
I just want to say thank you for teaching me how to make my own products when your products are too expensive.

Sincerely
tsjwang


Hey instructables!

First of all, I want to give absolute credit to Tequals0. You should check out his instructables account and follow him.

So, over the summer I needed to find a way to get OFF of the arduino board and onto smaller/cheaper microcontrollers for more permanent projects.
For a while I have been using the ArduinoISP sketch to upload files, but if I wanted to upload a hex file, I needed a real programmer (I needed a programmer that programs through the ISP and not through a serial port).

SO I looked at adafruit's USBTinyISP, which I must say, was VERY cheap comparing to Atmel's other programmers. USBTiny is also supported by Arduino IDE, so that's great too.

As cheap as it was, it was $22; I don't spend $22 on one thing.
so, let me get started on how to make your own usbtinyisp

Step 1: Design

Picture of Design

Attached in the zip folder are some PCBs I made for your convenience. There is a DIP version and an SMT version. I did SMT this time just for fun. There is no difference.

You don't have to use the PCBs if you just want to make a perf board or something. There is a schematic from Tequals0 and that is all that matters

Attached in that zip files are other important stuff too, so I will refer to those.

Parts:
ATTiny45
Some PCB or perf board or breadboard
100nf capacitor (104)
2*68 ohm resistor
1.7k ohm resistor ( I only had 1.6 and 100)
2*3.6v zener diodes
6 pin headers
some form of USB connection.

I advise you, if you are planning to do other VUSB projects, buy a lot of 3.6v zener diodes. VUSB has a LOT of cool projects!

Step 2: Programming the Chip

Picture of Programming the Chip

The truth comes out...

In order to programmer the ATTiny45, you will need another programmer that can upload hex files...
So I DID have to buy one from ebay for $10..
If anyone knows how to upload HEX files using Arduino, please do tell!
<EDIT>
There is a way to upload hex files using Arduino
Read this comment by Jgniklu,

To do that upload the Isp sketch like it the tutorial and set up all the wires connecting the attiny and arduino the same way.Now instead of burning the boot-loader and uploading a sketch you can use avrdude. You will have to change the -c usbtiny to -c avrisp so the first command should look like this avrdude -c avrisp -p t45 -U flash:w:usbtiny.hex
</EDIT>

If you do not have a target board, connect wires from the programmer to the appropriate pins on the ATTiny.
Here is a guide to using AVRDUDE and programming, thank you adafruit.



So anyways, in your folder should be a hex file. In some folder should also be a README.txt

So, please read the readme. It contains the commands you must type into the command prompt IN ORDER.

So first, I would type:
avrdude -c usbtiny -p t45 -U flash:w:usbtiny.hex

Then I would type:
avrdude -c usbtiny -p t45 -V -U lfuse:w:0xe1:m -U hfuse:w:0x5d:m -U efuse:w:0xff:m

Remember, before you do this, you must start you command prompt in the folder which the usbtiny.hex file is.

Attached in the folder is another text file that shows what should happen in the command prompt.

Make sure to do this correctly, because you only have one try
After burning the fuses, reset will be disabled and you will not be able to turn back unless you have a high voltage programmer


If you are unsure about anything, PM me or comment.

Step 3: Making the PCB

Picture of Making the PCB

So, this is pretty straightforward. Just look at the pictures.

If you did not program the chip yet, there is another option!
you can program it AFTER the PCB is finished (an option for you SMT people out there)

If you look at the schematic, the 6 pins, RESET, Vcc, GND, MISO, MOSI are all connected to the 6 pin ISP.

All you need to do is connect that ISP of your to-be-USBtiny to the other ISP on the original programmer. You can then upload the hex file and burn the fuses.

Step 4: Does It Work?

Picture of Does It Work?
After finish the soldering, plug it into the computer.
Install the USBTinyISP driver from adafruit if you haven't already.

Then, just type in the commands:
avrdude -c usbtiny -p m8

If you get something that says:
avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)
avrdude done. Thank you.

something is wrong... Check if you have your driver installed, your parts in the right place, or if you programmed your chip correctly.

If you get this:
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.

then good job! Now you have a pretty cheap USBtiny device. Go crazy.

Comments

jemamena (author)2014-02-22

Thanks for the tutorial, it's great!

Is it possible to make the usbtinyisp with an attiny85?

TSJWang (author)jemamena2014-02-23

Absolutely,

When typing in avrdude all you have to change is t45 to t85.

Thanks.

jemamena (author)TSJWang2014-07-19

What about an ATtiny84?

TSJWang (author)jemamena2014-07-20

Hmm probably not unless you change the source code which I did not write.
It probably could work, just some minor changes to the code.

ASCAS (author)2013-12-07

Great Idea! But have you encountered dx.com? They sell cheaper products (ex. Cloned Modules). It could help you with your projects. A UART costs ($3.60 w/free shipping)

TSJWang (author)ASCAS2013-12-09

Brilliance!
Thanks for the tip. Always striving for the cheaper option!

Jgniklu (author)2013-11-29

If you want to use your arduino as a programmer you can upload the arduino ISP sketch from examples menu in the arduino ide, Check out this instructable https://www.instructables.com/id/Turn-Your-Arduino-Into-an-ISP/ for more info.

TSJWang (author)Jgniklu2013-11-30

Hey Jgniklu,

Thanks for that link. Is there a way you can use Arduino to upload just a hex file, not a sketch?
Sometimes the things I want to upload are in AVR C instead of Arduino C, so I just upload the hex file. I will do a little search on what commands Arduino uses in avrdude to upload...

Jgniklu (author)TSJWang2013-11-30

To do that upload the Isp sketch like it the tutorial and set up all the wires connecting the attiny and arduino the same way.Now instead of burning the boot-loader and uploading a sketch you can use avrdude. You will have to change the -c usbtiny to -c avrisp so the first command should look like this avrdude -c avrisp -p t45 -U flash:w:usbtiny.hex

TSJWang (author)Jgniklu2013-11-30

Thanks Jgniklu! For saving me some time looking that up. I'll edit my instructables.

Bryan JimP1 (author)2017-09-12

What PCB designing software do you use?

TSJWang (author)Bryan JimP12017-09-12

I use Copper Connection. It used to be free software but now it's owned by ExpressPCB. It's essentially the same software but Copper Connection's UI is a little better.

mloro (author)2017-07-06

Quick one, looking at the images, mainly the one with the program you used to create the PCB, there is a 100 ohm resistor that is not mentioned nor in the required parts nor in your schematic, is that necessary? in case can you provide me an updated schematic with the100 ohm resistor just to be sure I've understand properly where it goes? (Just an hobbist so easy to do wrong things)

mloro (author)mloro2017-07-06

Looking better to the connections of the PCB diagram it seems basically you connect in series a 1.7k and 100 ohm resistors for a total of 1.8k and not 1.7k as in the schematic. Is that right?

TSJWang (author)mloro2017-07-06

Good question!

I think back then I only had 1.6k resistors, so I had to add a 100 ohm in series to get 1.7k.

I wrote 1.7k in the board because I assumed I had one at the time but I didn't.

aarongillbraun (author)2017-01-08

So it has to be exactly 1.7k? It cant be 1.5k or 1.6k. I made it exactly as shown (replaced 1.7k with 1.5k resistor). Successful hex flash, wiring double checked, but the darn:

Could not find USBtiny device (0x1781/0xc9f)

Always comes up. Is the resistor the problem?

TSJWang (author)aarongillbraun2017-01-08

I did not do the calculations for this circuit, but I do know USB is pretty sensitive voltage levels.
You can put two 100 ohm resistors or one 200 ohm resistor in series to your 1.5k resistor.

There are various reasons the USB device cannot be recognized, you'll have to debug it to find out which component is the issue if the resistor isn't the issue.

Good luck!

aarongillbraun (author)TSJWang2017-01-08

Thanks, dunno why 1.7k is so hard to find. I can only find it in SMD variant. Also im on mac, and presumably there are no drivers for usbtiny. The chip write was successful but for some reason, the command to check if it works, always replies with that darn error.

TSJWang (author)aarongillbraun2017-01-08

oh yea

in step two, you have to write the hex file, and then burn the fuses afterwards.

You won't be able to check if it works because we burning these fuses will brick the chip. It can no longer be read unless you have a 12v programmer.

aarongillbraun (author)TSJWang2017-01-08

So the:

avrdude -c usbtiny -p m8

Wont work after burning the fuses? I can only test for other chips attatched to my usbtiny?

TSJWang (author)aarongillbraun2017-01-08

I'm assuming your talking about programming the attiny?

you should be using the t45 chip. Yea, after you burn the fuses it becomes a programmer, you can only test for other chips attached to your new usbtiny.

see PeterK138's comment if it helps:

Hi guys correct way to upload that using arduino:
HEX: avrdude -P com3 -b 19200 -c avrisp -p attiny85 -v -e -U flash:w:usbtiny.hex
FUSE:

avrdude -P com3 -b 19200 -c avrisp -p attiny85 -v -e -U lfuse:w:0xff:m -U hfuse:w:0xdf:m

**

if it still doesn't work, feel free to dm me!

PeterK138 (author)2016-06-28

Hi guys correct way to upload that using arduino:
HEX: avrdude -P com3 -b 19200 -c avrisp -p attiny85 -v -e -U flash:w:usbtiny.hex
FUSE:

avrdude -P com3 -b 19200 -c avrisp -p attiny85 -v -e -U lfuse:w:0xff:m -U hfuse:w:0xdf:m

Calebe94 (author)PeterK1382016-10-17

Thank you so much! It works fine to me !

KotamrajuS (author)2016-03-17

Could someone please help out...... Made it on a breadboard..... Flashed the attiny45 with the usbtinyisp hex file(btw had to add -B3 at the end to make it through) But after that...... It is beign recognised as unknown device..... Though the drivers for UsbTiny is installed under the libusb-win32 devices.....

TSJWang (author)KotamrajuS2016-03-17

It might he a hardware problem. Usually it's a burnt diode. I would check those and perhaps flash another attiny45. what was the B3 for?

KotamrajuS (author)TSJWang2016-03-18

Hello,

Thanks for responding! :) ... have changed the diodes with new ones.... no change.... I used -B3 to change the bitclock rate..... i am quite new to this..... Had troubles while flashing the attiny45.... so found it as a solution in one of the websites.... I donot have a new chip to flash and i have flashed this one's fuses.... so probably i can't flash it again.... will try with a new one soon..... Is changing the clock rate a reason for this!?

ccamilleri1 (author)KotamrajuS2016-08-17

You can flash the chip again you just have to make a simple circuit. Visit this link to find out more. https://sites.google.com/site/wayneholder/attiny-fuse-reset

TSJWang (author)KotamrajuS2016-03-20

hmm

I haven't looked at this project in a long time. But I don't think adding the -B3 was a necessary step to get the attiny working? Did it not work using the commands in the instructions?

KotamrajuS (author)TSJWang2016-03-23

got the problem!! I forgot to place the 0.1uf capacitor while trying different solutions!!.... solved now!! Thank you!! :) the -B command is recommended in certain cases....based on this site!! http://www.simpleavr.com/avr/vusbtiny Thank you once again for trying to help me out!! :)

TSJWang (author)KotamrajuS2016-03-23

Awesome!

beic made it! (author)2016-07-01

I made it, but with a little modification and it's working great!

Thank you!

TSJWang (author)beic2016-07-12

I love it!

beic (author)TSJWang2016-07-12

Thank you! ;)

rtw1701 (author)2016-07-11

What's with the 1.7k resistor costing so much? Jameco didn't have them and at Mouser and Digi-Key they cost an arm and a leg. Guess I'll use 3.4k in parallel to get the 1.7k.

TSJWang (author)rtw17012016-07-12

It's a really weird number.

Maybe use a 1k resistor and some other 100 ohm resistors and put them in series?

PeterK138 (author)2016-06-28

Hi guys correct way to upload that using arduino as ISP:
HEX: avrdude -P com3 -b 19200 -c avrisp -p attiny85 -v -e -U flash:w:usbtiny.hex
FUSE: avrdude -P com3 -b 19200 -c avrisp -p attiny85 -v -e -U lfuse:w:0xe1:m -U hfuse:w:0x5d:m -U efuse:w:0xff:m

All work fine goodluck

Raffy611 made it! (author)2016-06-08

Nice instructable. I made mine on a pice of perfboard. Only struggle I had was the programming, I used an Arduino UNO as ISP but for some resaon Avrdude was not found, so I installed WinAvr which worked out for me. Only thing i needed to add was the correct Port with -P and the Baudrate with -b.Which in the case of the Arduino as Isp, is 19200. Now it works fine. Only think to add is maybe a case and something to prevent the wire to rip out since they are very thin.

TSJWang (author)Raffy6112016-06-08

It looks beautiful!

I think adding a blob of hot glue on the weak wire areas should do a good job of relieving stress from the wires.

Congrats!

Raffy611 (author)TSJWang2016-06-08

Yeah but the hotglue would ruin the look xD Maybe i could make a case out of some scrap plastic. e.g old CD case maybe

domiluciano (author)2016-06-02

Didn't work. I keep getting this error from Windows. And yes, the drivers are installed, and yes, I followed all your instructions exactly.

"A request for the USB device descriptor failed"

TSJWang (author)domiluciano2016-06-04

That's difficult.

In confusing situations like this you should take a break then come back to the board with a fresh view.

One brute force last attempt way to fix this is to systematically replace components, or try starting over to save the effort

(after all its $5)

Good luck! let us know if there's any more details or updates.

beic (author)2016-03-09

Hi there,

One question, the Zener's are 1/2 or 1 W?

Thank you! ;)

TSJWang (author)beic2016-03-09

That is a good question, I'm not sure.

Try using whatever you have on hand and let us know. According to this: https://forum.sparkfun.com/viewtopic.php?f=5&t=284...

1/2 W is proven to work.

beic (author)TSJWang2016-03-10

After looking the schematic again, I figured out that the Zener's can be 1/2W because they are on USB Data line + and -, so, there is no big current consume!

IHateCheese (author)2016-02-11

I finished the circuit on a breadboard and it doesn't work. How do I install the drivers?

TSJWang (author)IHateCheese2016-02-11

what exactly is happening?

IHateCheese (author)TSJWang2016-02-12

Further progress. It works, and here's how I did it in case anyone is having trouble:

I had to use different drivers for Windows 10, and the same drivers are needed for Windows 8/8.1. Get them here:

http://www.adafruit.com/downloads/usbtiny_signed_8.zip

TSJWang (author)IHateCheese2016-02-12

Great job!

IHateCheese (author)TSJWang2016-02-12

OK, progress.

Turns out I had a 16K resistor in instead of a 1.6, with the 100 in series. Now it registers as USBTinyISP but I can't install the drivers, the error is as follows:

"Windows encountered a problem installing the drivers. The system cannot find the file specified."

Any ideas? If it's any help, I use Windows 10.

IHateCheese (author)TSJWang2016-02-12

I get an error 43: device descriptor request failed. when I plug it in. I think it may be due to missing drivers, but I'll try flashing a new chip as well.

About This Instructable

63,072views

176favorites

License:

Bio: These instructables are mostly about electronics. I hope you find them helpful!
More by TSJWang:Game of Life With Nokia 5110 LCDLED Audio Waveform Display (100% Code Free!!1)DIY Apple Clock
Add instructable to: