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!
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.
November 16th, 2011 at 3:04 amThis is used to program Atmel’s AVR series microcontrollers through USB port.