UsbProg-SHARP
UsbProg-SHARPA Multi-purpose USB Device
Introduction
This project is an instance of the UsbProg project created by Benedikt Sauter.Bene released the schematics, board layout and firmware as an open-sourceproject.I took that project and made these modifications:
[*]Changed CONN1 to a type Mini-B receptacle (so it would be surface mount).
[*]Changed most parts to have surface mount packages (except jumpers and headers).
[*]Added capacitors C1 and C2 for decoupling.
[*]Added CONN3 2x5 pin header for Port A (the ADC inputs).
[*]Added JP3 jumper header to choose which pin controls LED1.
The addition of JP3 has special considerations.Place a jumper across JP3 pins1 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 iscontrolled by PD7.This frees up PA4 so that all 8 pins of PORTA can beused.PORTA is available via CONN3.When the jumper is in this position,the UsbProg-SHARP board is no longer compatible with stock UsbProg firmwareand 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 projectusing at-home etching techniques.
Status
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.
Log:
[*]2007/11/12: I corrected the values for C8,9 to 27 pF in the BOM afterreceiving a review from Steve.C8,9 still have the wrong value in theschematic.
[*]2007/08/12: Benedikt emailed me a new firmware binary for avrispmk2klonthis morning that allows the UsbProg-SHARP to enumerate on a Mac!By the end of the day, Bene had put the new code in the subversion SCM.
[*]2007/07/30: Fuse settings were changed to be in agreement with thosesuggested here.
[*]2007/07/29: The board communication problems were due to 3 ATmega32 pinsnot making contact with their pads.Reflowing those pins solved the issue.The board is functional.Fuses were set so the ATmega32 will use the clockfrom the USBN9604.
[*]2007/07/28: Etched and populated the board rev 2007/07/26.Attempted to flash the ATmega32 via ISP, but niether AvrDude nor AVR Studiocould communicate with the board.An effort is underway to debug thecommunication problem.
[*]2007/07/26: Changed the 2x5 headers footprints to be thicker(larger annulus).
[*]2007/07/22: Changed the footprint of the two 2x5 Headers to bethrough-hole.Arty felt that the surface mount headers might peel-offwhen subjected to the forces on a ribbon cable.
[*]2007/07/19: Updated schematics and layout to UsbProg 3.0(per schematic on UsbProg mailing list)
Schematic
Parts ListThe following table presents the parts list for a single UsbProg-SHARP board:
Part No.PartPackageDigiKey Part No.VendorQtyPriceSubtot
IC1ATmega3244-TQFPATMEGA32-16AU-NDAtmel18.178.17
IC2USBN960428-SOICUSBN9604-28M-NDNational Semi15.855.85
Q1Crystal 24 MHz (18 pF)HC-49XC702CT-NDECS Inc10.730.73
CONN1USB Mini-B ConnMini-B SMTH2961CT-NDHirose11.391.39
CONN2,3Hdr 2x5 shop elsewhere 2
JP1,2,3Hdr 1x3 shop elsewhere 3
JP4Hdr 1x2 shop elsewhere 1
R1R 1M0805RHM1.00MCCT-ND 10.38/100.04
R5R 100 K0805RHM100KCCT-ND 10.38/100.04
C8,9C 27 pF (xtal load)0805PCC270CGCT-NDPanasonic20.49/100.49
C11C 1 uF (decouple 3.3v)0805399-1172-1-NDKemet11.21/100.12
C1,2,6,10C 100 nF (decouple 5v)0805PCC1828CT-ND 40.62/101.24
R2,3,4R 1.5 K(LED pullup)0805RHM1.50KCCT-ND 30.38/100.04
R6R 10 K0805RHM10.0KCCT-ND 10.38/100.04
LED1,2LED (green)0805404-1021-1-ND 22.51/250.20
Grand Total18.35
Jumpers
This section explains the purposes of the four jumpers on the UsbProg-SHARPand the meanings of the different settings.
[*]JP1: Connects either Vcc or GND to the ATmega32's RESET' pin.Connect JP1 pin 1 and 2 to apply Vcc to the RESET' pin.This is the defaultsetting and is used for normal operation of the UsbProg.Connect JP1 pin 2 and 3 to apply GND to the RESET' pin.This settingkeeps the ATmega32 in reset state which is needed to re-flash the ATmega32(a.k.a. Bootloader mode).
[*]JP2: This is an output connector for the ATmega32's USART.You should notapply a jumper to any of these pins.JP2 pin 1 is GND, pin 2 is RX and pin 3is TX.The pins are at "TTL" level and cannot connect directly to a PC'sserial port.An RS-232 level shifter is necessary to connect to a PC'sserial port.
[*]JP3: Selects which ATmega32 pin lights up LED1.Connect JP3 pin 1 and 2in order for PA4 to light LED1.This is the default setting (compatible tothe original UsbProg).Connect JP3 pin 2 and 3 in order for PD7 to lightLED1.This setting should only be used if you need all PORTA pins on CONN3when running custom firmware on the ATmega32.
[*]JP4: Serves to connect Vcc (which is +5V from the USB bus) to CONN2 pin 2.The default setting is to place a jumper on JP4 so that +5V is applied to thetarget device.An alternate method is to remove JP4 so +5V is not applied to target devicesthat supply their own power.
Results
The first attempt at etching a board was on 2007/07/22.This attempt was notsuccessful because the layout transparency was scaled 5% smaller than thenecessary size.However, the etching technique worked very well and theresulting 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-plateto simultaneously solder many components.
The second attempt at etching took place on 2007/07/28.With thetransparency at the correct scale, we etched the board (revision 2007/07/26).Again, the etching process produced a fantastic board.Clean traces withempty spaces in between.We populated the board using Kester solder pasteand a hot air gun set to 302 degrees C.The order of the components was asfollows: USB mini-B connector, all 0805 components, crystal, USBN9604and the ATmega32.The header connectors, jumpers and seven air wires werethen soldered using a solder pencil.
After one night of debugging, the board is able to communicate with anAtmel STK500 and be programmed!The board is functional.A second day of work and the board is recognized by a Win32 PC andoperates as a clone of AVRISP mkII.
Engineering Notes
Crystal Capacitors
This section explains the choice of capacitors connected to the USBN9604'scrystal resonator circuit.
ECS's CSM-7 series crystals have a load capacitance of 10 pF minimum, 20 pFTypical and "series" as a maximum.
The "rule of thumb" equation is:
Cload = Cxtal^2 / 2*Cxtal + CparasiticFor Cparasitic = 0:
20 = Cxtal^2 / 2*CxtalCxtal = 40 pFFor Cparasitic = 4 pF:
20 = Cxtal^2 / 2*Cxtal + 4Cxtal = 32 pFMeet 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 padsReflowing 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.hexCheck the fuses in interactive mode:
avrdude -p atmega32 -P /dev/cu.USA19H191P1.1 -c stk500v2 -tavrdude> dump lfuse>>> dump lfuse0000e1 |. |avrdude> dump hfuse>>> dump hfuse000099 |. |Set new fuse values (still in interactive mode):
avrdude> write hfuse 0 0x89>>> write hfuse 0 0x89avrdude> write lfuse 0 0xe0>>> write lfuse 0 0xe0Verify the changes took (still in interactive mode):
avrdude> dump hfuse>>> dump hfuse000089 |. |avrdude> dump lfuse>>> dump lfuse0000e0 |. |>>> quit
页:
[1]