I built a Bus Pirate

I built a Bus Pirate! Now that’s out of the way, I’ll talk about how I built it and some things I learnt along the way. First thing to help you solder up a bus pirate or any surface mount PCB is to find a guide or someone to show you how, I’d recommend taking a look at Dave Jones’ SMD soldering video: EEVBlog #186

Additionally to this, a good thing to have is some good equipment.

All the components used to built up the bus pirate

Some good solder is a must; I used 0.35mm solder for assembling the bus pirate. I used leaded solder but some may want to use lead free solder, I usually use lead free stuff, however I don’t have any small enough and borrowed a reel of 60/40 solder. Sometimes it’s possible to use too much solder, and trying to flick the solder away can’t always work so get some 1-2mm solder wick (sometimes known as solder braid or copper braid) and soak up that extra solder.

A flux pen can also be really handy if you need to tack on devices or need to wave solder a fine pitch IC (I didn’t wave solder my chips, but it’s something I want to learn how to do correctly). Usually flux (even from the solder) will leave a residue or even some unused flux on the board, so have a electronic circuit board cleaner handy to help clean it up (make sure to read the directions and safety advice, and that it’s suitable to clean your boards).

There are moving the components themselves, if you think you might prototype a lot of SMD boards or just want to be prepared in case you do, take a look into investing in a good pair of tweezers. I borrowed the pair pictured for doing the bus pirate because of the small components, however I have also got a pair of fairly bad tweezers which I used to remove and solder a new voltage regulator (I’ll get to that later).

Lastly inspecting the joints can be done if you have good eyesight (or lack the tools) but the best method is to use a good light (I have a 3W LED lamp which I use at home, in the soldering lab at my university, they have a magnifier with a bulb for inspecting work, however the red and yellow magnifier seen in the picture was very useful for inspecting some of the solder joints of the fine pitch objects. Or seeing the mark I made on the board...

Now I can always tell if it's mine!

There is of course solder irons to do the soldering itself; I used 3 types for soldering, although you don’t need that many (one was used for removing components either because they were soldered in the wrong way, or I blew them up as well). Just a good temperature controlled soldering iron with a good tip (I used both a ‘fine’ conical and spade tip and actually didn’t mind working with either, use what you’re most comfortable with) and some fine solder.

The spade tip used, although my own soldering iron has a larger tip The conical tip used

I also used a tweezers type to remove the LEDs (I soldered them backwards; again, I was sure I read the data sheet correctly) and the burnt out capacitors I soldered backwards. Which brings me onto something which others might think is pointless and logical, but some components will mark the positive side (I made an assumption which turned out to be incorrect; that the marked side was negative), particularly the LEDs I had as well as the tantalum capacitors. However, read the device’s datasheet to ensure you’re soldering it in the right way, if you point it in the wrong way, it might be hard to get it off again without special tools. I’ve managed to remove a voltage regulator (will go into it later) with just a spade tip and a pair of tweezers without too much effort.

The tweezer type soldering iron, handy for removing SMD components

The process I used for the ICs/multi pin devices was to put solder on a pad, melt the solder while also moving the component into position with the tweezers. Soldering the other side of the device to hold it into place, while ensuring the first pin has got enough solder before continuing to solder the rest of the pins. If you get a solder bridge, just clean it up with the solder wick, hold the wick against the pins which are bridged and heat the wick with the soldering iron, the wick will ‘suck’ up that excess solder easily.

The capacitors and resistors were actually the easiest components to do, a blob of solder on one side before, like the multi pin devices/ICs, heating up that blob and moving the component into place before doing the other side. The resistor networks were similar to soldering the ICs, however a little tricker I found to get the pins to not bridge (although I later found the 2 pins that kept on bridging were connected on the PCB anyway).

If you’re going to solder up one of these boards, make sure you do the ‘lowest’ components first, although there will be times where it makes better sense to solder an IC and then the smaller components around it since it could be harder to get your soldering iron in to solder the pins. For the bus pirate, I soldered IC2 (FTDI chip) and IC3 (analogue multiplexer) first before doing the capacitors (Except for C10 and C11), resistors and LEDs. After soldering in the resistor networks, I put on the voltage regulators, then the actual microcontroller itself (IC1) and the USB header. Lastly I put the ferrite bead, the tantalum capacitors and headers onto the board. This, of course, is when the board didn’t have its black marking but the capacitors were soldered around the wrong way (I plugged the board into my desktop’s USB port and the capacitor went pop).

The next thing to do after getting the board built up is to program the microcontroller with the bootloader. The instructions are available here(link here; http://dangerousprototypes.com/docs/Programming_PICs_with_a_programmer), but use an older version of the MPLab IDE. I borrowed and used a PicKit3 for programming the bootloader into the microcontroller). The following are the instructions I used after attempting to find the options shown in the original instructions, but failed to find the same options, most likely due to my inexperience with the programmer and IDE.

  1. Open up the IDE.
    Showing the main MPLab X IDE window, freshly installed
  2. Goto the file menu and select Import > Hex/ELF... (Prebuilt) File
    Where the import menu is
  3. Select the bootloader firmware, your microcontroller and your programmer from the list and click next
    The import's menu first screen, select the hex file, the microcontroller and your programmer
  4. Give your project a name and where to store it, set it as the main project as well before clicking next
    The import's menu second screen, select where to store the project and set it to your main project
  5. Click Finish
  6. Connect the programmer to your computer and then connect your bus pirate to the programmer and your computer (the programmer didn’t provide power to my bus pirate, most likely because I didn’t set up the programmer to give the target power)
    Note the extra USB cable to the Bus Pirate itself, so the BP's regulators are used
  7. Goto the Run menu and select Run Project, this will program your bus pirate
    Finally programming the bus pirate's bootloader
  8. Follow the rest of the instructions to program the firmware of the bus pirate, a female to female jumper wire helps, but shorting it with something (or a solder bridge) will work!
Programming was successful! Luckily my university had these jumpers Programming the bus pirate's firmware, this was actually the 2nd time I tried as the first time failed It failed the self test thanks to some voltage regulator problems Testing the bus pirate and make sure it's working

If you weren’t successful uploading the bootloader to your bus pirate, try checking that the main voltage regulator is outputting 3.3V (mine was outputting 2.35V, unknown why this is, I suspect the microcontroller could be damaged) and that the components (mainly C11, the tantalum for the microcontroller) were soldered in the correct way, although most people won’t make the mistake I did. Also check that your board is receiving power, either through your programmer or some other means, I mentioned the voltage regulators previously as I powered the board with its own regulators.

This is what happens if the Bus pirate isn't connected or when it isn't powered

In the pictures of my bus pirate now, you can see an extra wire from a capacitor near the FTDI chip to a pin on the main voltage regulator (VR1), this is because a self test of the bus pirate yielded a strange result, the board didn’t pass the voltage rail and ADC tests as it makes an assumption that the microcontroller is getting 3.3V; This made me investigate further. I first measured the output of all of the voltage regulators and found VR1 to be outputting 2.35V which explained the strange result. I attempted to tie the 2 3.3V regulators together to see if that would work however the results were the same. In a final attempt, I tried touching a lead between the capacitor on the output of the FTDI chip, which has an integrated 3.3V regulator, and the output of VR1 and was pleased to see the power LED, which is powered by the output of VR1, increased in brightness. A wire, which is too long but I decided not to shorten it, was soldered between the capacitor and the output of the voltage regulator which brought up the input to the microcontroller to 3.3V. I feel this is a ‘temporary’ fix however I don’t plan on finding out the true cause of this problem and it will remain unknown until I decide it’s affecting the performance of the bus pirate’s functions.

That wire is too long, but it works! And it's another indicator it's mine!

Lastly, I’d like to thank the team at Dangerous Prototypes for sending me the Bus Pirate v3.5 SOIC PCB after I asked for one and also the people who let me borrow the equipment I needed to solder it as well as help debug what was wrong with the bus pirate as I tried it.