Frankly, I didn't even expect it to work so didn't take any photographs. I recently decided to make it again with a few improvements(notice the old orange one has the top backwards) and document it for Instructables. You have to make one of these if you:
Note: You need to break out of the chicken-n-egg problem and get the program onto the ATtiny2313 used in this project. Check out Step 4 for detailed information and possible solutions.
Edit: Modified board so resonator can also be used for timing! If using crystal, middle pin for resonator can be ignored. If using resonator, no need to solder capacitors C1 and C2.
Step 1: Chicken-egg Downloads
The chicken-n-egg situation while working with microcontrollers is that you need to get your program in a microcontroller to program another microcontroller. I know that's whacky but it's only one-time. There are some ways which I'm listing below. You only need one:
I will be using the earlier version of USBtinyISP I made. I had used a parallel programmer to program it's ATtiny2313. You only need a few minutes to upload the USBtinyISP code onto your ATtiny2313, so you can get someone's help who has a PC with parallel port/serial port/AVR programmer/Arduino.
If you're going to someone's place to get ATtiny2313 programmed, remember to download and keep these files in a pendrive:
To use, install all that you've downloaded and extract the firmware zip file to a convenient location.
Step 2: Stuff you need
Rest of the stuff needed depends on your PCB fabrication method. I use toner-transfer so I need clothes-iron, glossy paper, laser printer etc.
And last but not least, TIC-TAC!
Step 3: Etch that PCB
Download the Eagle files attached at Intro step and etch the circuit into your single-sided copper clad board. This is not an instructable on how to etch PCBs so I'll breeze through it. If you need to learn how to etch PCBs, there are tons of cool instructables out there. I'll be using the famous toner-transfer method.
Recipe for PCB fabrication:
Step 4: Drilling, sanding and silkscreening
Now cut off the excess board material from the sides and sand the edges. I also made little grooves for the USB jack's claw-like thingies to sink into. Keep popping tic-tacs throughout this step. It will help you get through the tedious drilling/sanding while increasing concentration and skill(not scientifically proven).
Silkscreen is the outline of components and neat descriptive labels on top of the PCB. Since this is a single sided board, I pasted a printout on the top side of the board. It got blotched and soggy after I cleaned the bottom side with rubbing alcohol but that was just my stupidity. You can also iron the silkscreen the same way as toner-transfer method.
Just select 20 Dimension, 21 tPlace and 51 tDocu layers and print. Cut and paste it but use glue sparsely else it will plug your laboriously drilled holes. If you are using toner transfer to apply silkscreen, leave out 51 tDocu layer and check Mirror option while printing.
Step 5: Program ATtiny2313
Now let's burn the firmware onto ATtiny2313:
avrdude -p attiny2313 -c usbtiny
Replace usbtiny with your programmer's name. List of programmers can be generated using: avrdude -c ?
You should get output-1(lablled in image) which means everything is working fine. If you are getting error like Output-3 in 2nd image, check wire connections again.
avrdude -p attiny2313 -c usbtiny -b 19200 -U hfuse:w:0xdf:m -U lfuse:w:0xef:m
You should see something like Output-2.
avrdude -p attiny2313 -c usbtiny -B 1 -U flash:w:main.hex -b 19200
This should also end successfully. If not, did you have a button connected to RST and did you press it? Congrats! Your ATtiny2313 is programmed with USBtinyISP firmware code. You can return the programmer you borrowed with heartfelt gratitude and a pack of tic-tac. :)
Step 6: Soldering
Start soldering the IC holder pins first. Then solder everything else except ICSP pins, electrolytic capacitor, male jumper header and USB jack.
Step 7: Soldering electrolytic capacitor
Solder it in place keeping the polarity in mind, but keep a few mm of leads separating the capacitor from board. Now bend it into a horizontal position. Don't worry if you kept the leads a bit too long and it ends up resting on a pillow of the adjoining resistor, instead of being flush against the board. You just need to make sure that it is low enough to fit in the box.
Step 8: Soldering male headers
This easily accessible jumper option is available so that you can power the AVR IC you are programming with USB power supply. Connecting a jumper means target IC will be delivered USB 5V. Removing it will cut it off. Never have a jumper on this if you are powering your AVR with some other source. Clashing power supplies are not good for your AVR and programmer.
Also, if you have a 6 pin ICSP header or IDC cable(cable with ICSP headers pre-connected with ribbon cable), then solder 3x2 male headers in the holes labelled ISP. I couldn't find any of them in local stores, so I made a small hack to replace the cable. If you follow in my footsteps, do leave the ISP holes as is for now.
Solder the USB jack as well and bend those claws flat against the bottom of board.
Step 9: Fitting USB jack in top lid
Step 10: Making makeshift IDC cable
This is where we may go down slightly different paths. If you have ICSP connector with ribbon cable, then follow the instructions at bottom of this page where ladyada shows how to make the IDC cable from ICSP connector and ribbon cable. Make a hole at the bottom of tic-tac box big enough for your connector and cable to pass through and attach it to the male header pins you soldered earlier, keeping in mind that the dot on silkscreen and key/bump on connector are on the same side.
If you are following my method, then cut off a 6 wire ribbon cable choosing the edge with stripe. Then I stripped and twisted the wire ends and arranged the wires in 3x2 kind of formation. Every alternate wire was on kept on the same side. This then went into the ISP 3x2 holes in the PCB with the pink striped wire going into the pin with the dot(MISO) and soldered. Keep it like this if you are only going to use it on breadboard. But if you want to use ICSP headers on boards like Arduino, then read on. Also, now is a good time to test whether this is working or not.
If it's working fine, cut a slit at the bottom of your recently-emptied tic-tac box and thread the unsoldered end of the ribbon cable through it. Take the mini tic-tac box and cut a slit in it's top cap and a pretty big one at the bottom. Thread the ribbon cable through the top and out of the bottom.
Step 11: Making ICSP connector
First solder the 6 vias in the PCB which are providing connection between top and bottom layers. Put a thin bare wire through the vias, solder it at both ends and snip off the excess wire.
Cut off 2 3-pin female headers and stick them together so they form a 3x2 female connector. Now place it on top side and solder it's pins on the bottom side. Finally, bring the wires from ribbon cable emerging from the bottom of mini tic-tac and solder them the same way they went into the main board. Insert the pink striped wire into the hole with the dot(MISO) and the next one in VCC, then SCK and so on.
Notice this is a mirror image of the layout of these pins in the main board. This is because these female headers will connect to male headers on board and need to be mirrored so they align properly.
Just glue the ISCP connector PCB to the bottom of mini-tic-tac box and we're done!
Step 12: Program away!
You can see a close-up of the old and new version's ICSP connectors. The old one was compact but the header was on the bottom of the big tic-tac box and so the PCB couldn't be slid out for repairs without snipping the wires connecting header with board ISP pins. Also, the big enclosure would sometimes not let the male and female headers to interact properly due to tall vertical components on some boards. The whole weight of the programmer also bore down on the connector and slight movement of USB wire caused it to jiggle.
Try it out and program arduino codes onto stand-alone AVR ICs using this to make cheap and simple bare-bones Arduinos for your projects. Or you can put a fresh AVR into your Arduino and program it using Arduino's built in ICSP headers with this. Have fun programming!
Thanks to catlinsdad for motivating me to make my first Instructable...
If you liked this, please vote for the UP contest.