A Multi-purpose USB Device

Copyright: Copyright Dean Hall 2007. All rights reserved.
Author: Dean Hall
Revision: 9
Date: 2007/11/12


This project is an instance of the UsbProg project created by Benedikt Sauter. Bene released the schematics, board layout and firmware as an open-source project. I took that project and made these modifications:

The addition of JP3 has special considerations. Place a jumper across JP3 pins 1 and 2 to make UsbProg-SHARP exactly compatible with the original UsbProg.

Or, optionally, place a jumper across JP3 pins 2 and 3 so that LED1 is controlled by PD7. This frees up PA4 so that all 8 pins of PORTA can be used. PORTA is available via CONN3. When the jumper is in this position, the UsbProg-SHARP board is no longer compatible with stock UsbProg firmware and requires a special version of the firmware that has yet to be created.

Myself and other members of SHARP are making circuit boards for this project using at-home etching techniques.


The board works when connected to a Win32 PC and with an update to the firmware, enumerates on a Macintosh as well! However, there is still no Mac OS X driver; work shall begin on that soon.



The following schematic represents UsbProg-SHARP which includes the changes listed above and some small "clean up" changes per my own preferences.

Here is the EAGLE schematic file: usbprog.sch

Picture of the circuit schematic


I created the board layout from scratch. I did this because my goal is to make a layout that can be etched using home-brew techniques. This means I have put as many traces on the top side as possible. All traces are 10 mil (0.010 inches) and in-between spacing is 10 mil or greater. There are roughly seven bottom-side traces that will require air-wire soldering. Most bottom-side traces end at a via or pad. The holes for the vias do not need to be drilled, but drilling does make placing the air wires easyer. Alternatively, a fine wire (for example, wirewrap wire) can be soldered to the via's top pad.

I also changed a few parts, such as the USB connector to type mini-B, so that the part would be surface mount on the top side. One exception to this is that both connector headers are through-hole. This was done because the pads for a surface mount header might not be able to withstand the physical forces on a ribbon cable.

Here is the EAGLE board layout file: usbprog.brd Here is a mirrored PDF so you can print a transparency and etch your own. A mirrored layout is given so that you can place the toner side of the transparency face to face with the etch-resist side of the copper board.

Picture of the circuit layout

Parts List

The following table presents the parts list for a single UsbProg-SHARP board:

Part No. Part Package DigiKey Part No. Vendor Qty Price Subtot
IC1 ATmega32 44-TQFP ATMEGA32-16AU-ND Atmel 1 8.17 8.17
IC2 USBN9604 28-SOIC USBN9604-28M-ND National Semi 1 5.85 5.85
Q1 Crystal 24 MHz (18 pF) HC-49 XC702CT-ND ECS Inc 1 0.73 0.73
CONN1 USB Mini-B Conn Mini-B SMT H2961CT-ND Hirose 1 1.39 1.39
CONN2,3 Hdr 2x5   shop elsewhere   2    
JP1,2,3 Hdr 1x3   shop elsewhere   3    
JP4 Hdr 1x2   shop elsewhere   1    
R1 R 1M 0805 RHM1.00MCCT-ND   1 0.38/10 0.04
R5 R 100 K 0805 RHM100KCCT-ND   1 0.38/10 0.04
C8,9 C 27 pF (xtal load) 0805 PCC270CGCT-ND Panasonic 2 0.49/10 0.49
C11 C 1 uF (decouple 3.3v) 0805 399-1172-1-ND Kemet 1 1.21/10 0.12
C1,2,6,10 C 100 nF (decouple 5v) 0805 PCC1828CT-ND   4 0.62/10 1.24
R2,3,4 R 1.5 K(LED pullup) 0805 RHM1.50KCCT-ND   3 0.38/10 0.04
R6 R 10 K 0805 RHM10.0KCCT-ND   1 0.38/10 0.04
LED1,2 LED (green) 0805 404-1021-1-ND   2 2.51/25 0.20
Grand Total 18.35


The first attempt at etching a board was on 2007/07/22. This attempt was not successful because the layout transparency was scaled 5% smaller than the necessary size. However, the etching technique worked very well and the resulting board looks clean despite the many fine-pitch traces and footprints. We also learned a few things about solder paste and how to use a hot-plate to simultaneously solder many components.

The second attempt at etching took place on 2007/07/28. With the transparency at the correct scale, we etched the board (revision 2007/07/26). Again, the etching process produced a fantastic board. Clean traces with empty spaces in between. We populated the board using Kester solder paste and a hot air gun set to 302 degrees C. The order of the components was as follows: USB mini-B connector, all 0805 components, crystal, USBN9604 and the ATmega32. The header connectors, jumpers and seven air wires were then soldered using a solder pencil.

After one night of debugging, the board is able to communicate with an Atmel STK500 and be programmed! The board is functional. A second day of work and the board is recognized by a Win32 PC and operates as a clone of AVRISP mkII.

The copper & component side of the UsbProg-SHARP board
The connector and air-wire side of the UsbProg-SHARP board


This section explains the purposes of the four jumpers on the UsbProg-SHARP and the meanings of the different settings.

Engineering Notes

Crystal Capacitors

This section explains the choice of capacitors connected to the USBN9604's crystal resonator circuit.

ECS's CSM-7 series crystals have a load capacitance of 10 pF minimum, 20 pF Typical and "series" as a maximum.

The "rule of thumb" equation is:

Cload = Cxtal^2 / 2*Cxtal + Cparasitic

For Cparasitic = 0:

20 = Cxtal^2 / 2*Cxtal
Cxtal = 40 pF

For Cparasitic = 4 pF:

20 = Cxtal^2 / 2*Cxtal + 4
Cxtal = 32 pF

Meet halfway: Cxtal = 36 pF; Digikey doesn't have 0805 of this rating. Using nearest-valued 0805 instead: Cxtal = 39 pF.

Debugging and avrdude

No connect between IC1 pins 1, 8, 40 and their pads Reflowing solder, testing, passes:

cd ~/Code/other/usbprog/avrisp...

flash the code:

avrdude -p atmega32 -P /dev/cu.USA19H191P1.1 -c stk500v2 -U flash:w:main.hex

Check the fuses in interactive mode:

avrdude -p atmega32 -P /dev/cu.USA19H191P1.1 -c stk500v2 -t
avrdude> dump lfuse
>>> dump lfuse
0000  e1                                                |.               |
avrdude> dump hfuse
>>> dump hfuse
0000  99                                                |.               |

Set new fuse values (still in interactive mode):

avrdude> write hfuse 0 0x89
>>> write hfuse 0 0x89
avrdude> write lfuse 0 0xe0
>>> write lfuse 0 0xe0

Verify the changes took (still in interactive mode):

avrdude> dump hfuse
>>> dump hfuse
0000  89                                                |.               |
avrdude> dump lfuse
>>> dump lfuse
0000  e0                                                |.               |
>>> quit