DIY $5 USBTinyISP

by TSJWang in Circuits > Electronics

75909 Views, 200 Favorites, 0 Comments

DIY $5 USBTinyISP

DSC_5842.JPG
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

Design

programmer_schematic.jpg
screen.png
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!

Downloads

Programming the Chip

DSC_5790.JPG
DSC_5791.JPG
ATTINY25-pinout.jpg
avr_isp.png
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.

Making the PCB

DSC_5824.JPG
DSC_5825.JPG
DSC_5827.JPG
DSC_5828.JPG
DSC_5829.JPG
DSC_5830.JPG
DSC_5831.JPG
DSC_5832.JPG
DSC_5833.JPG
DSC_5834.JPG
DSC_5835.JPG
DSC_5836.JPG
DSC_5837.JPG
DSC_5838.JPG
DSC_5839.JPG
DSC_5840.JPG
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.

Does It Work?

DSC_5841.JPG
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.