Pirates... Aaaarrrrgh!

November 27, 2009

3 Min Read
Pirates... Aaaarrrrgh!

Greetings gadgeteers.  Today we’ll talk about a bus pirate, even though it’s not Pirate Day.  The Bus Pirate is an interesting device that I’m still trying to get my head around.  The PCB contains a PIC microcontroller, a USB connection, and a 10 pin header.  The board is powered by the USB connection.  The header provides 5v0 and 3v3 power supplies, ground, a clock, an analog voltage in, and a handful of other pins that can be configured to support quite a few serial protocols:  I2C1-WireUARTSPIJTAG, and within these protocols many standard devices:  PC keyboards, MIDI, text LCD displays, SDcards, device programmers, and others.

How does it work?
The Bus Pirate is connected to your PC and detected in the usual USB fashion.  You communicate with it via a terminal program.  Hyperterminal works OK, but Tera Term is much better.  Once you’re connected the Bus Pirate displays a menu in your terminal.  Different menu options allow you to:

  • Turn on the 5v0 and 3v3 supplies

  • apply pullups or pulldowns

  • select a serial protocol

  • send or receive data using the selected protocol

  • configure the PC side serial baud rate

  • measure voltage on the analog in pin

  • measure frequency

  • generate a clock or PWM signal

  • other stuff also

Many of these commands are scriptable, and can be collected into macros.

What can you do with it?One use of the Bus Pirate is to experiment with a chip that has one of these serial interfaces without using a microcontroller, having to breadboard, or even write firmware.  Many chips can be powered up using the 5v0 or 3v3 supplies.  The appropriate serial connections and any needed chip selects are wired appropriately to the 10 pin header, and then the serial port is driven by the PIC under the control of the host.  This can all be done with flying leads if the chip or module of interest is a DIP package, or otherwise has leads that you can attach clips to.

There are examples on the Bus Pirate manual page that show how you can use it to drive a small Nokia LCD using a Ruby script that runs on the PC host, serial EEPROMS, and character LCD displays.

These are all fairly straightforward projects to do using a microcontroller, however you would have to spend some time writing the firmware to configure the hardware, send the output, receive the input, etc.  With the bus pirate you can do it all on the fly, or write your code on the PC using a high level scripting language.

The Bus Pirate is open hardware and software.  The schematics and board files are readily available and you can easily build your own.  It can also be purchased for about $30 from SeeedStudio.com, which has many other electronic odds and ends that you might find interesting.  The Bus Pirate home page has a good article on the history of the bus pirate.  Towards the end of this article is some good information about what they learned about PCB layout, component selection, and other things by taking this board from prototype to production.

Thumbs up

I think Bus Pirate is an interesting project and a very useful tool to have available at the price.  I think a great addition to this project would be a GUI front end that would allow you to point/click to configure it and create macros, logging all of the commands used so that once completed the log can be reused as a script in the future.
Happy gadgeting, and Happy ThanksgivingSteve Ravet

Sign up for the Design News Daily newsletter.

You May Also Like