I don’t have desktop with legacy ports and don’t like going to friend’s home every time I need to download something to an AVR. I asked myself “how can i build a simple diy avr USB programmer?” .
Well, actually I asked Google, and the answer was Usbtiny. Below I’m describing my simplified Usbtiny programmer.
It’s basically an extremely cut version of UsbTinyISP by Ladyada.When I went to build the v2.0 of the programmer, I’ve made it first on breadboard, and everything ran perfectly and it was able to do the job nicely. Next, I started removing sidekicks.
First, I’ve removed the 74HC125 buffer and gave direct programming lines to the target, and it did worked. Next, I’ve removed few other resistor and capacitor and left only the essential ones.
I’ve converted the ISP connector and USB connector to pin headers and after doing my job, it is left with the main Attiny2313 IC, one 12Mhz crystal, and four resistors. It looks like the v1.0 of Usbtiny but it has even less parts count. The Usbtiny v2.0 has total 17 discrete parts, except connectors and the Usbtiny v1.0 has 15 discrete parts. In my modified version, there is 6 discrete parts (less than 40%),
- Attiny2313 main IC
- 12Mhz crystal
- 3.3K reset pullup resistor
- 1.5K D- pullup resistor
- USB bus resistor 2x 68R.
With this minimum surrounding, everything worked correctly. I could have fabricated one small PCB for this but it’s so small and tiny, that I made it on a small piece of veroboard.
I’ve customized the pin layout of the ISP header to meet the sequence I needed. It’s VCC-GND-MISO-MOSI-SCK-RST.
I’ve used this one to program Attiny2313, Atmega8, Atmega32 everything worked nicely. There’s no filtering capacitor in the circuit, nor there is 18-22pf grounding capacitors for the crystal, but everything is greatly working.
I stripped down the hardware much and removed the two indicator LEDs which were for
1. Programming : Surely, I know when I am programming, so no need of the LED, and
2. USB OK: If device didn’t initialized properly and connected to USB, I’ll get error from avrdude as “Error: Could not find USBtiny device (0×1781/0xc9f)” , what’s the need of the LED then.
Next, I’ve thought to minify the program, but then thought that was unnecessary. The firmware being 2046bytes, fits tightly into the 2048bytes space in Attiny2313. Minifying the code will make it fit in lesser space, but that space would never come useful in any user’s project. Hence I’ve selected the v2.0 firmware as default.
Note: To burn the firmware to Attiny2313, you’ll need another programmer, you are adviced to use any of these simple programmer that you can use with Serial port, or Parallel port.
Programming Instructions for downloading firmware to Attiny2313
- Download the USB driver and also firmware for v2.0 from Ladyada site.
- Burn the firmware by AVRdude or by PonyProg and set fusebits as example
avrdude -c stk200 -p t2313 -U hfuse:w:0xdf:m -U lfuse:w:0xef:m
Reference Source: Ladyada and Instructables.
Update: PCB design and Final version
Comments on this article before 07-12-2011, here jump to recent comments.
-
K Scharf on October 14, 2011 - 8:34 pm
Leaving out the two capacitors from the crystal pins to ground is generally not a good idea. While it may have worked in your case, those caps are often needed to support oscillation. If you leave them out the device may become un-reliable. Use a ceramic resonator instead of the crystal, it’s cheaper and the caps are built in!
Arup Reply:
October 15th, 2011 at 9:57 amYeah, I also thought it. But when in breadboard, I was removing non-essential components, it was discovered that those capacitors was not needed.
And as for ceramic resonators, they are pretty less stable than crystals. USB is a serial communication where timing is a vital thing, hence I used crystals. -
Dhrubajyoti Dey on November 15, 2011 - 10:58 pm
Priyo Arup, ei circuit tar kaj ta thik ki, ami bujhlam na, USB AVR programmer er actual kaj ta jodi ektu bujhiye bolo tahole khub upokar hoy. Agrim Dhanyobad janai.
Arup Reply:
November 16th, 2011 at 3:04 amThis is used to program Atmel’s AVR series microcontrollers through USB port.
Shikhir says
I am familiar with picaxe platform and I know BASIC. Now I am going for the AVRs . I want to know if this programmer can take analogue signals from the microcontroller and display them in the programming software on the PC .I don't know much c++ but in the picaxe we use debug command to display the values from various analogue inputs .Thank You
Arup says
No. It's only programming device.
Debashis Sinha says
Your comunity is too good.Please join me in yours comunity.Thank you.
Vito says
Because we used the pin 16 of the ATtiny2313, if the datasheet, it is referred to as the pin 1 (reset/RST)?
Arup says
PIN1 is (reset/RST) of the Attiny2313. And for programming we're using PIN16 as host RST pin for resetting then target MCU.
sabs says
'm new in this avr world ....i have a doubt that ic(attiny2313) which has inbuilt programmed for these kind of applications...or we need to program in attiny 2313 ....?
Mr.KG says
you are using serial programmer to program tiny2313.
so, you can use it for other controllers also.
i mean what is the advantage of usbtinyisp programmer?
Vishal says
can it work with my atmega16 ?
Nicolas says
Hi, i will try this as soon as i get the components. Is it possible to program the ATtiny2313 using an arduino mega board as ISP instead of a parallel/serial programmer?
Thanks for the answer!
Adrian says
So you need a serial or parallel programmer to program attiny to make another programmer that is now usb? If a person have serial or parallel port and a programmer for that ports, why would he need to make another one for usb? One programmer is enough, no?
Arnab says
As I was following the post author for long, I've a faint idea about this post.
Actually it's a very old post, written somewhere around 2012. Back then desktop with a serial port was common, but not laptops.
The author used friends PC's serial port to program the USB AVR programmer to use with his laptop.
But now programmers are fairly cheap, around US $2.
Kromka Chleba says
Because his/her other/ new computer has nothing else besides USB.
Manoj Soorya says
Hi Arup...
Any exact link for the hex file for Attiny2313 and chip burning application software?
Its to difficult to find the correct one.
Ari_Jana says
I want to design an AVR programmer by creating a clone Arduino Uno. Please help me what can I do.I am totally confused.
Thinhx2 says
Thank mate, it working fine