Trying out the Bus Pirate v4

So I got myself the Bus Pirate v4.0 the other day. And was I ecstatic! I couldn’t wait to try it out so I was forced to unpack all my electronics from the boxes since I’ve moved in.

So what is the Bus Pirate?

The Bus Pirate is a embedded circuit board that allows a person to communicate with electronics on various types of communication buses using a simple serial interface. One could fire up a serial terminal application, connect to the device through USB, and be able to talk to electronic devices over hardware protocols such as I2C, SPI, and 1-wire.

The Board

Top-down View of Bus Pirate v4.0
Top-down View of Bus Pirate v4.0

The board features:

  • mini-USB plug on the left
  • The Microchip PIC24FJ256 microcontroller
  • A 2×6 connection header for connecting peripherals. The 2×6 header provides I/O as well as power supply pins.
  • Two push button switches (Normal and Reset)

Communicating with the Bus Pirate

To communicate with the Bus Pirate, you will need a USB cable to connect to the mini-USB socket on the board. You will then need to get software that can communicate with the board. The board is seen as a serial port device and any software that can communicate with a serial port would do. These are usually called terminal emulators or Telnet clients. PuTTY is a program that I love to use for things like this. Many others exist too.
The first thing to do is find out the COM port that the board is connected to. You can do this by going to your Device Manager and opening the “Ports (COM & LPT)” section to see all ports available on the system. On my system, the Bus Pirate is on COM3 and identifies as a “USB Serial Device”.
Knowing this, I can fire up PuTTY and configure it to communicate with the Bus Pirate:

  1. Set PuTTY’s connection type to “Serial”
  2. Enter COM3 as the “Serial Line”. This is the communications port on which PuTTY will talk to the board.
  3. Enter 115200 as the Speed. The so-called baud rate at which PuTTY will talk to the board. 115200 is the speed at which the Bus Pirate communicates.
  4. Clicking on Open to start the communications session.
PuTTY config for Bus Pirate
PuTTY config

When the session starts, you may not see anything but a blank screen. Before panicking, press Enter first and see if something appears.
If communication was set up correctly and the Bus Pirate is connected, you will be welcomed with the prompt:
HiZ>
This indicates the current mode the Bus Pirate is in, Hi-Z, which basically means that all I/O pins are in a high impedance mode. This just means the pins are neither pulled high or low. Also, in this mode, the onboard power supply of the Bus Pirate is deactivated. This is a generally safe mode to be in to protect both the Bus Pirate and your circuit from short-circuits or the like.
Typing ? followed by Enter will show a help page of available commands you can give the Bus Pirate:

Bus Pirate Commands
Bus Pirate Commands

On the next page, I’ll quickly show one of the simplest task to do with the Bus Pirate: reading an analog value.

Facebooktwittergoogle_plusredditpinterestlinkedinmail

1 thought on “Trying out the Bus Pirate v4

  1. Quite a nice blog. I’m not at all “techy” but all the bright colors, along with the word “pirate” made me want to read more about it. I must admit, I didn’t grasp much of it, but those that are the “techy” type will love it for sure!

Leave a Comment