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 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:
- Set PuTTY’s connection type to “Serial”
COM3as the “Serial Line”. This is the communications port on which PuTTY will talk to the board.
115200as 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.
- Clicking on Open to start the communications session.
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:
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.
? followed by Enter will show a help page of available commands you can give the Bus Pirate:
On the next page, I’ll quickly show one of the simplest task to do with the Bus Pirate: reading an analog value.