Introduction: Hacking Your Digg Button With a Removable Interface Cable
As it comes from adafruit, it's a counter that displays the number of times it's button has been pressed. The open i/o lines can be connected with jumpers (small pieces of wire) to produce a couple of different behaviors.
But, with a simple parallel interface connecting it to a computer, it can be a sturdy platform for experimenting with microprocessor programming.
The site, [www.ladyada.net], which has all the instructions and support forums for adafruit products, has instructions for some simple software hacks based on ponyprog 2000, a program for communicating with the microprocessor. The site also describes how to make a simple parallel port connector to connect the Digg Button to your computer. The description is very straight forward, but it requires soldering the connector to the Digg Button. This is not conducive to hacking your button then displaying your warez.
SO, since I like showing off what I do, I designed a simple clip-on connector that allows me to easily connect and disconnect my Digg Button for hacking. I also created a modded version of the Button firmware, which I'm calling diggX, that can be uploaded using this cable and can itself be hacked using ponyprog 2000.
Here's a video demo that shows the connector in use and describes the firmware hack:
Should be easy to finish this in an hour
- (1) Right-angle break-away pin header strip with at least 6 pins spaced at .1" (Jameco #686111 -- this is a 6-position header, you might order several, or get a longer one in case you mess one up)
- (1) Several feet of #24 stranded hook-up wire (Jameco #734405. Yellow. This is for a 100' roll which is a little overkill. RadioShack has #22 hook-up wire which would technically work, but will be a little bulkier.)
- (6) Connector socket pins (optional. Jameco #496421, these are the cheap ones. You can get pricier versions with different metal, but these seem to work OK)
- (1) 8" or so of 1/16" heat shrink tubing (only 3" needed if not using the socket pins. Jameco #419127, black)
- (1) D-Sub Connector with solder terminals (male or female, see text. Jameco #223010 for male, #223079 for female.)
- (3) ~1k ohm resistors (Jameco #690865, this is for quantity 100. You can get in sets of 5 from RadioShack)
- (1) Fast setting epoxy (5-minute, or so, available everywhere). Epoxy putty also works fine.
- (1) Short piece of "hobby stick", a couple of inches long
- (2) Small binder clips (from any office supply, the 3/4" ones are a good size)
If you are going to connect the cable directly to your computer port, you'll probably need a male connector. On the other hand, that isn't very convenient. You're always having to look around behind your computer to see what's going on with the Button. For a few dollars, you can buy a "straight-through" parallel cable that plugs into your computer port on one side and the interface cable you're building on the other. That's what I use. It has male connectors on both ends. In that case, you should get a "female" D-Sub connector so it'll plug into the cable.
Make sure to use stranded wire, solid wire would be too stiff and difficult to handle (though it *would* technically work)
Tools (some of which you'll probably have if you built the Digg Button to begin with):
- Wire cutters
- Small pliers (I actually use small jewelry pliers I got from a craft store)
- Soldering Iron and Solder (standard 60/40 thin-ish electronics solder)
- Hair dryer (hot) or heat gun for shrinking tubing
- Wire strippers (I use the very simple type shown in the photos and they work fine)
- Small project vise (e.g. PanaVise Jr.)
Now, assuming you've gathered everything together, on to the building part.
Step 1: Prepare the 6-Pin Connector
If you look at the back of the Digg Button circuit board, you'll see six small connector pads at the top. This is where the connector attaches. It turns out that the pad centers are spaced .1" apart which is one of the standard board spacings. That's lucky for us, because the pin headers have pins also spaced at .1".
To make talking about the connector pads on the circuit board easier I'm going to assign the letters A-F to the pads. If the back of the board is towards you facing right, the pad on the top is "A", the next one is "B", etc. until the pad on the bottom, which would be "F". Note: I'm talking about the little pads which are actually connected to the circuit, not the big wide pads that go nowhere.
Anyway, you may have a right-angle pin header that has more than six pins. Technically, you only need five pins to connect to the D-Sub connector, but I think it's easier to avoid mistakes in clipping the header to your Digg Button to use all six pads. In this case, you need to break off (or, clip off) a six-pin section to use for your connector.
The header pins will be clipped to the board with the right-angle part touching the board and the other end of the pins facing back away from the board. Notice which is the "A" pin, "B" pin, etc.
Step 2: Prepare the Wires
Now, you need to prepare the wires for the cable. If you're soldering directly to the D-Sub connector you probably only need to use five wires (Pin "A" is the one not used), but I'm assuming that you'll be making a general cable and will use all six. Building a "universal" cable with six wires and connectors on one end will allow you to connect the cable to an ISP programmer if you want to later (I've successfully connected my Digg Button to the AVRDragon). But, that's out-of-scope right now.
I made my wires 6" long. I was thinking I didn't want them too long to avoid any kind of electrical interference that sometimes comes from long bits of wire. But, in retrospect I think 8" or 10" probably would have been OK and would have been more convenient. So, cut six (or five) bits of wire to the length you want.
After the wires are cut, strip about 1/8" off each end (this is where the wire stripper will save you much grief!).
To make the wires easier to solder later, "tin" the ends of the wire by melting a very small amount of solder on each end. Be careful not to heat the wires too much, or the insulation will melt making them a little harder to work with later.
Step 3: Prepare the Heat-Shrink Tubing
Heat-shrink tubing is used to isolate the wires at the connector ends. If you are also using the socket pins, the tubing will fit over the pins to stabilize them and make them easier to handle.
Actually, when I first designed this, I hadn't planned on using epoxy on the connector, so needed something to make sure wires didn't touch each other on that end. If you use epoxy (or epoxy putty) you don't actually need the bits of heat-shrink tubing there, though they do add a nice bit of color if you use clear epoxy. SO, use them or not.
For the six (or five) bits near the right-angle pin header, you can use 1/4" pieces of tubing. For the other end, 3/4" is necessary. If you don't want to think too much, you can probably just cut all tubing pieces to 3/4". Note, that I used two different colors making the "F" pin different from the others just to make it easy to recognize for orientation.
Step 4: (Optional) Solder the Socket Connectors to One End of the Wires
If you're going to solder your wires directly to the D-Sub connector, you can skip this step. But, you might want to read through it anyway. It's a handy technique I use often to make removable wires.
This is a fiddly procedure, but basically you place the wire in the connector and crimp it with some small pliers to hold it in place while you solder it. Then you finish the crimping job to make it more solid.
Look at the pictures. They're probably more clear than anything I could write.
Until you solder the wire in the connector, the assembly is pretty fragile. I use an alligator clip epoxied to a small wood square to help hold things when I need a third hand. There are other ways to do it (like using a friend). But, it's best to hold the *connector* rather than the wire. Otherwise, it's not stable enough to solder.
When you solder, you should make it pretty swift, or you can melt the insulation and then sometimes the wire will fall out. But, you'll get the hang of it.
After the solder has cooled, complete the crimp with pliers to hold the wire in place.
Step 5: Solder the Wires to the Pin Connector
Now, its time to solder the wires to the pin connector. Its the touchiest part. If you use too much heat you can melt the plastic around the pins and they'll begin to wobble. So, I think it's best to use your vise (or something else) to hold the header while you make quick solder connections. The other important technique is to "tin" the pin header just like you did the wire (but, with a little more solder). Then you can just heat up the wire and pin to melt their solder together and you have a joint.
Once the header pins have cooled from tinning, solder the first wire on. Start at one end of the header and work towards the other to make it easier to get the soldering tip close to the solder connection. Note that you're soldering to the shorter, non-right-angle part of each pin. The only thing holding each wire to its pin, is the solder. Try to make the wires extend directly away from each pin rather than at any angle.
When all the wires are soldered and cooled, it can help stabilize the header if you slide the plastic strip as far away from the solder connection as possible. The easiest way to do this is to put the header/wire assembly on the table with the wires facing straight up. Use a small screw driver to carefully press the plastic between the pins towards the table. With the right amount of pressure the plastic will begin to slide.
Step 6: Position and Shrink the Heat-Shrink Tubing
Once all the wires are soldered, and the plastic positioned, slide one piece of heat-shrink tubing (1/4" if you made them different lengths) along each wire and over each connection. This will help stabilize the connection and take a little stress off the solder joint. Make sure the tubing covers the solder joint and doesn't slide all the way over to the plastic (maybe a good reason for using 3/4" for all pieces of tubing).
When all the tubing is in place, you can use a heat source to shrink it. I use an old hand hair dryer. But, if you have a heat gun, you can use that too. In any case, be careful not to burn yourself or anything else. I actually use a silicone rubber trivet from a kitchen store as the backing for heating the tubing. It's heat resistant and reflects heat from the heat source back to the tubing and seems more efficient. Note: if the hair dryer overheats, it will often shut off (thermal breaker of some kind) and won't start again until it's cooled down. And, did I mention to be careful?
Step 7: (Optional) Cover Socket Connectors With Heat Shrink Tubing
You'll only do this if you're not soldering wires directly to your D-Sub connector.
First, slide a piece of heat-shrink tubing over each pin socket. Bring it as far flush as possible to the end of the connector, then use your now expert technique with the heat gun to shrink each piece. They make very tidy connectors that are easy to use. If you're using different colors of heat-shrink tubing, make sure the offsetting colors are on the same wire. (e.g. in the picture, wire "A" uses blue tubing on both ends and all other wires use red).
You can place and shrink these one at a time (more reliable). Or, if you're confident you can place them all then shrink them all at the same time. (but, watch that the tubing doesn't shift during the shrinking process)
Step 8: Epoxy the Header Connector Wires
To make the right-angle header sturdier and easier to handle, I glopped on some quick-setting epoxy. Follow the instructions on the epoxy container to mix the two parts. I use a tooth pick for stirring and usually mix the epoxy on cardboard or paper folded over (so the epoxy doesn't seep through).
I waited until the epoxy began to thicken just a little (but not too long!) then scooped some up with the toothpick and spread it over the wires and connected pins. Make sure not to get epoxy on the bare end of the pins or making a connection with the circuit board will be difficult. The epoxy will want to drip off the connector, but by cleverly turning the connector over as the epoxy begins to sag, you can keep it more-or-less in place. As the epoxy begins to harden, it's easier to keep it in place until it finally sets and you can stop worrying about it. Set aside the cable assembly until the glue is finished setting.
addendum: I recently made a new connector using epoxy putty rather than liquid epoxy. This worked quite well and was a bit easier to manage since the epoxy wasn't trying to drip off while it was curing. However, the putty is opaque, so I lost the delightful see-through effect.
Step 9: Prepare the D-Sub Connector
On the ladyada site, there are directions about how to connect the D-Sub connector. The connections to our clippable connector are the same, but implemented slightly differently. I cut an end of the resistor leads a little on the shorter side (it doesn't make any different which side is shorter, but if you look at the colored rings and pick the same end for all the resisters, it will be more orderly looking).
For the following instructions, you can look at the pictures to see which pins are soldered. Or if you have just the right light and squint through a magnifying glass, you can see the numbers printed on the socket. Choose a male or female socket depending on whether you're connecting directly to your computer's parallel port (male D-Sub), or a cable (female D-Sub).
Next, solder the resistors to the appropriate pins. Resistors are connected to pins 2, 4, and 5. Make sure the short lead is the one connected to the connector with the longer one left free. That covers three of the five connections.
For the other two connection, I used the ends clipped off the resistors and soldered them to the other two connectors (You can check the ladyada site to confirm pins ... I've also put notes on an attached image to show which pins have resistors and which are direct wires). Wires ends are connected to pins 11 and 20.
One note about technique, just like we tinned the pin and wire when soldering to the pin header, it's easiest to melt a bit of solder on the D-Sub pins then reheat to solder in the resistor or bit of wire.
Once all five D-Sub pins have leads soldered on, you can use wire cutters to trim them all to the same length making sure to leave enough length on the resistors to attach to the wires.
Step 10: Attach Wires to the D-Sub Connector
The last step of construction is to attach wires from the pin header to the D-Sub. If you installed the pin sockets, all you have to do is slide them over the protruding wires on the D-Sub. If you're soldering directly, then you just match up wires and solder them.
Hopefully, by now, the epoxy has dried enough to handle. If not, take a short break and come back. I'll be less messy that way.
Using our lettering scheme from before the wire are connected as follows:
Pin-Header "A" = not connected
Pin-Header "B" = D-Sub Pin 20
Pin-Header "C" = D-Sub Pin 2 (resistor)
Pin-Header "D" = D-Sub Pin 11
Pin-Header "E" = D-Sub Pin 5 (resistor)
Pin-Header "F" = D-Sub Pin 4 (resistor)
Step 11: Connect Everything Up
The basic process is:
- Clip the stick on one side to the back of the Digg Button board over the solder pads.
- Slide the connector between the stick and the solder pads making sure to line the pins and pads up
- Clip the other side of the stick to apply pressure on the connector
Once the board is connected, plug the D-Sub connector into either your cable or parallel port.
As you might expect, if anything begins to smoke (highly unlikely), unplug things fast!
Step 12: Install and Run PonyProg 2000 to Test Everything Out
This connection can be a little finicky. The connectors have to be clean (from time to time I use a small amount of alcohol on a paper towel). I've also found that placing the connector so the tips of the pins are against the pad rather than the middle of the pins, makes for a more reliable connection.
And, your parallel port has to be configured properly. My connection would not work until I changed my port from general bi-directional to ECP in my computer's firmware config. (I got to my firmware settings by holding down the ESC key as the computer was booting up then figuring out and following the on-screen instructions). You may have to check your computer's documentation to see how to access its firmware on bootup, if you think it's a problem.
The mods page on the ladyada digg button site, http://www.ladyada.net/make/digg/mods.html, has detailed instructions for getting ponyprog up and running. I won't duplicate them here. You should first try to "read" your button to make sure the cable works. Once you can read your device, you can also write it.
To read the Digg Button, choose "Read All" from the Command menu
If ponyprog fails to find your device, make sure:
- The cable is wired correctly
- It is connected to the board correctly
- The Digg Button has power (e.g. battery)
- Wiggle the connector on the board (but, be careful, connecting together pads "A" and "B" can short out your battery leading to short battery life!)
- Reboot the PC (it's lame, I know, but sometimes it works!)
- Reboot the PC *without* the parallel cable connected, then connect it afterwards (and sometimes mystical incantation helps).
Step 13: Upload DiggX, Modified Firmware for the Digg Button
Once you've unzipped the files, you can use ponyprog 2000 to upload it. All you do is select "Open Device File" from the File menu and choose the diggX.hex file. Then you choose "Write All" from the Command menu. With some small luck, ponyprog will write and verify the new code and your Digg Button should begin running the new firmware (you can see this go by quickly in the video).
The modded firmware features are:
- Longer scrolling and selfish message ("digg me" rather than "digg").
- A short button press increments the counter and plays the "dug" animation.
- A long button press resets the counter to zero and returns to scrolling
- A timeout after 2 minutes of no presses returns the Digg Button to scrolling (but doesn't reset the count) ... kind of a screensaver mode that helps attract diggers.
- A long timeout after 5 minutes of no presses puts the Digg Button into sleep mode to conserve power. Pressing the button wakes it up again.
SO, there you have it!
You are now empowered to hack and have your own fun with the Digg Button!