Monday, May 16, 2011

USB prototyping board part 2: Breadboarding it

You can draw schematics all day long, but the only way to make sure the circuit works is to get busy on the bench. You can see the result in the picture below. I affectionately call it "the world messiest USB keyboard". 


Let's run through the main parts of the circuit:

On the far left you can see the USB wires (5V, Ground, D+ and D-) coming in. Stripping a USB cable is surprisingly tricky as the wires are very thin and made out of very fragile stranded material. In the end I managed to solder D+ and D- to leads that I could stick into the breadboard, whereas 5V and Ground are connected to jumper cables using alligator clips. As you can see, this is a massive short circuit hazard. If you are going to be doing this a lot, you need to invest in some sort of USB connector break-out solution.

D+ and D- (green and yellow respectively) connect through the termination resistors (blueish) to the proper pins on the micro-controller (black thing in the middle). D- is pulled up to the 5V rail (bottom) using a resistor.   The zeners are visible connecting D+ and D- to the ground rail (top). This is the USB part of the circuit. If you are unsure about what connects to what and why, you can cross-reference the image with the schematic in Part One.

At the extreme right you see the 10uF smoothing cap. This is arguably the worst place to put it as it should be near to the power source, the USB connector in this case.

The octopus-like thing at the top is the ISP programmer cable. It connects to six of the eight pins of the micro-controller to allow programming. Immediately to the right of the micro-controller is a weak pull-up on the reset pin. This makes sure the circuit is free from reset glitches, but still maintains programmability.

There is also an RGB led, with three separate current-limiting resistors, to the right of the micro-controller. These are not connected, but are used during assembly to see if parts of the circuit are "hot". 

After setting the fuses to use the internal RC oscillator at 16 MHz and flashing it with the EasyLogger firmware using the programming cable and an usbtinyisp programmer this contraption is recognized as an USB keyboard and starts spitting out bogus ADC values into my editor. Joy!

No comments:

Post a Comment