Bus Pirate

From DP

Jump to: navigation, search

bp-action-2ii

Support this open source project, get a Bus Pirate v3' 'for $30, including worldwide shipping. Now also distributed by Adafruit Industries.

Read about the Bus Pirate v3 design and the v3b update.

The Bus Pirate is an open source hacker multi-tool that talks to electronic stuff. It's got a bunch of features an intrepid hacker might need to prototype their next project. This manual is an effort to link all available Bus Pirate information in one place.

PLEASE READ:v4 bootloader upgrade and v4 firmware.


Contents

[edit] Introduction

[edit] Reference

[edit] User terminal mode

The Bus Pirate is accessed from a command line in a serial terminal. The Bus Pirate always starts in high impedance mode (Hi-Z), a safe mode with all outputs disabled. It's intended to protect any connected devices from conditions beyond their specifications. From there, a bus mode can be selected to use the Bus Pirate with a specific protocol.

[edit] Binary scripting mode

The Bus Pirate has a binary access mode that can be used with software or scripts. There's example scripts in C, Python, Perl, and more in the SVN repository.

Binmode protocol pages: SPI, I2C, UART, 1-Wire, and raw-wire.

[edit] Various probe cable pinouts

[edit] Feature guides

[edit] Deprecated

These features have been temporarily removed.

  • JTAG (user terminal mode only, see OpenOCD support above)

[edit] Firmware upgrades

[edit] Bootloader v4

[edit] Bootloader upgrades


Bus Pirate firmware change history

[edit] Hardware documentation

[edit] Mods

[edit] Known Defects

[edit] Source

[edit] Application guides

[edit] Apps that support the Bus Pirate

[edit] Utilities

[edit] Chip demonstrations

Here's a comprehensive list of Bus Pirate chip demonstrations. It includes Ian's old demonstrations from Hack a Day, and the most recent demos from Dangerous Prototypes. Tutorials are arranged by Bus Pirate hardware version.

Bus Pirate v2&v3

Bus Pirate v1a

Bus Pirate v0a

[edit] I/O header pin descriptions

mode-guide

This table displays the Bus Pirate pinout in various modes. The Bus Pirate I/O pins try to be consistent across all libraries, the same pins are used for similar functions. Unused pins are usually in a safe high-impedance state.

Modes not shown in the above diagram are similar to other libraries: MIDI=UART; raw2wire=HD44780=PC keyboard=I2C; raw3wire=SPI. All bus pins output at 3.3volts, but tolerate up to 5volts (5.5volts maximum). Pins are named as they pertain to the Bus Pirate, not necessarily how they connect to the target device. 'In bus sniffer modes each pin becomes an input for the same signal usually assigned to that pin.

Master-out slave-in (MOSI) is the primary data pin, it's used for bi-directional data transfer in protocols like I2C and 1-Wire, and as data-out from the Bus Pirate in uni-directional protocols like SPI and asynchronous serial (UART). In bus sniffer modes each pin becomes an input for the same signal usually assigned to that pin.

Clock is always a clock-out signal from the Bus Pirate, except in the PC keyboard library where the keyboard provides a clock signal to the Bus Pirate.

Master-in slave-out (MISO) is used with protocols that have a dedicated data-input, such as SPI and UART.

Chip select (CS) is an output used to activate the serial interface in SPI-like protocols. Use the auxiliary pin config menu (c) to get manual control of the CS pin through the auxiliary pin commands (a, A, @).

The auxiliary pin (AUX) can be used as an output or input from the Bus Pirate terminal interface with the A, a, and @ commands. It's useful for protocols that require an additional signal, such as a reset.

BPv3v2go-pinout

Pin name
Description (Bus Pirate is the master)
MOSI Master data out, slave in (SPI, JTAG), Serial data (1-Wire, I2C, KB), TX* (UART)
CLK Clock signal (I2C, SPI, JTAG, KB)
MISO Master data in, slave out (SPI, JTAG) RX (UART)
CS* Chip select (SPI), TMS (JTAG)
AUX Auxiliary IO, frequency probe, pulse-width modulator
ADC Voltage measurement probe (max 6volts)
Vpu Voltage input for on-board pull-up resistors (0-5volts).
+3.3v +3.3volt switchable power supply
+5.0v +5volt switchable power supply
GND Ground, connect to ground of test circuit

Notes: * TX moved from CS to MOSI in firmware v0g.

[edit] User interface

Talk to the Bus Pirate from a serial terminal set to 115200bps, 8/N/1.

* Syntax error, type ? for help
HiZ>

Press enter to show the command prompt if your terminal is blank.

HiZ>m <<<set mode command
1. HiZ
...
10. LCD
(1) ><<<press enter to select default option (1)
Mode selected
HiZ>

Most configuration and option prompts have a default value shown in (). Press enter to select the default option.

Read more in the Bus Pirate 101 tutorial.

[edit] Configuration menus

Menu options are single character commands that configure the Bus Pirate. Type a letter, followed by <enter>, to access the menu. Some options are unavailable in some modes and on some hardware.

[edit] Bus interaction syntax

A simple syntax is used to interact with chips. Syntax characters have the same general function in each bus mode, such as 'R' to read a byte of data.

[0x31 r:5]

This example syntax sends a bus start , the value 0x31, and then reads 5 bytes, followed by bus stop. Up to 4000 characters of syntax may be entered into the Bus Pirate terminal at once, press enter to execute the syntax.

[edit] Macros

I2C>(0)
0.Macro menu
1.7bit address search
2.I2C sniffer
I2C>(1)

Macros perform complex actions, like scanning for I2C addresses, interrogating a smart card, or probing a JTAG chain. Macros are numbers entered inside (). Macro (0) always displays a list of macros available in the current bus mode.

Bus Pirate menu options guide

[edit] License

----

The Bus Pirate pinout, menu, and command tables are released into the public domain. Based on the public domain Bus Pirate documentation at Hack a Day.

Personal tools