Bus Pirate Daughter Board

_images/bus_pirate_front.webp

Description

Bus Pirate daughter board is designed to interface with and communicate between different electronic devices via numerous protocols such as I2C, SPI, UART, and others. The Bus Pirate daughter board is the physical board that hosts all the components necessary for the Bus Pirate's functionality. Human-speed interactive communication with an unknown device or chipset like this is a much easier way of learning its behavior, compared to writing codes, or building a prototype for testing. Our Bus Pirate daughter board has rolled in all the hardware programmer, debugger, cables, and interface tools into one piece with illustrative documentation. It offers interactive diagnostic features compared to those other single-function tools. If you interested in working with digital electronics, our Bus Pirate is the go-to tool you can rely on. You can write program or read a microcontroller, program and probe CPLDs, FPGAs, ARM micros, and other JTAG devices, can set multi-level operating voltages to pinouts, connect to serial devices over a USB to serial connection, read or write Flash and EEPROM memory chips, communicate with any SPI or I2C-based chip, passively sniff the SPI or I2C bus while in use to record the traffic.

Features

The Bus Pirate is a versatile device that can be used to analyze, debug, and control various electronic circuits and devices. It supports a wide range of communication protocols, including:

  • Serial (UART): For communicating with microcontrollers, modems, and other serial devices.
  • I2C: For communicating with sensors, microcontrollers, and other devices using the I2C bus.
  • SPI: For communicating with microcontrollers, flash memory, and other devices using the SPI bus.
  • JTAG: For debugging and programming microcontrollers.
  • SWD: For debugging and programming microcontrollers using the Serial Wire Debug interface.
  • 1-Wire: For communicating with devices using the 1-Wire protocol.
  • MIDI: For communicating with musical instruments and devices.

In addition to these protocols, the Bus Pirate also has several other features, including:

  • Bit-bang mode: Allows for manual control of individual pins.
  • Logic analyzer: Can be used to capture and analyze bus traffic.
  • Pulse width modulation (PWM): Can generate PWM signals for controlling devices.
  • Frequency measurement: Can measure the frequency of signals.
  • Voltage measurement: Can measure voltages between 0 and 5.5 volts.
  • Software-selectable pull-up resistors: Can be configured to provide pull-up resistors for different voltage levels.
  • Onboard power supplies: Includes onboard 3.3 volt and 5 volt power supplies.

For further details about the Bus Pirate features, please refer to the Bus Pirate website .

Technical Details

_images/Bus_pirate_Pinout_v1.0.png
DB pin# Pin Name Arduino Pin Description
12 VBAT   Supply voltage for Bus Pirate.
2, 11,13 GND   This pin is connected to System GND.
3 Mainboard RX 38 The RX pin on the mainboard UART listens for incoming data transmitted by the Bus Pirate.
4 Mainboard TX 32 The TX pin on a mainboard UART transmit data to the Bus Pirate.The TX pin on a mainboard UART transmits data to the Bus Pirate.
7 Mainboard RTS 12 The RTS pin indicates the readiness of the WiPhone to receive data. When the WiPhone is ready to receive data, it asserts the RTS signal (sets it to high). This signals to the bus pirate that it can send data.
8 Mainboard CTS 13 The CTS pin indicates that the receiving device is ready to receive data from the WiPhone. When the receiving device is ready, it asserts the CTS signal (sets it to high). This signals to the WiPhone that it can begin transmitting data.

Hardware Overview

_images/20240804-BusPirateLegened.png

ICSP Header

_images/ICSPHeader.png

The ICSP (In-Circuit Serial Programming) 5-pin header is used for programming and debugging PIC microcontrollers. It provides connections for power, ground, data (PGD), clock (PGC), and reset (MCLR), enabling direct communication between the programmer and the PIC MCU. This allows for convenient programming without the need to remove the microcontroller from the circuit board.

Bus Pirate - IO Pins

_images/BusPirateIOs.png

The Bus Pirate's IO pins offer a flexible and powerful way to interact with a variety of electronic components and systems.

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

Status LEDs

_images/statusLEDs.png
  1. Power indicator (PWR): This LED lights up when the Bus Pirate is powered by a supply.
  2. RX transmit indicator (RX): This LED flashes when there is data traffic from the PIC to the WiPhone.
  3. Mode indicator (MODE): This LED lights up when the Bus Pirate is set to a protocol mode through the user terminal (menu 'm'). The I/O pins may be active when the mode indicator is on. When the mode LED is off, the pins should be in a safe, non-powered, high-impedance state.
  4. Voltage regulator indicator (VREG): This LED lights up when the onboard power supplies are activated via the user terminal (command 'W').

Microchip PIC24FJ64GA002

_images/PIC24FJ64GA002-SOIC-28.png

The Microchip PIC24FJ64GA002 is the primary microcontroller in the Bus Pirate, managing communication protocols and executing user commands. With its 16-bit architecture, 64KB of Flash memory, and multiple built-in peripherals, it allows the Bus Pirate to interface with protocols like I2C, SPI, and UART. Its low-power design and versatility make it ideal for real-time debugging, programming, and communication tasks, making the Bus Pirate a powerful tool for hardware prototyping and hacking.

Bus Pirate Firmware Update via Pickit3

_images/Pickit3.png

We pre-install the firmware on the Bus Pirate daughter boards before shipping. However, if you want to update the firmware to the latest version or if you have bricked your Bus Pirate daughter board, here is a brief guide on how to update the firmware using the PICkit3 tool. If you are using PICkit 3 for the first time to your system, you need to install the PICkit 3 software. Install the software “PICkit3 Programmer Application Setup v3.10.zip”

  1. Install PICkit3 Software: If you are using the PICkit3 for the first time, you need to install the PICkit3 software. Download and install the software from “PICkit3 Programmer Application Setup v3.10.zip.” from the resources section at the end of documentation.
  2. Connect PICkit3: After successful installation, connect the PICkit3 to your system and open the software “PICkit3 v3.01.”

If the PICkit3 is connected properly, you should see the following screen:

_images/PickitConn.png
  1. Connect PICkit3 to Bus Pirate: Use a 5-pin 2.54 mm male header to connect the PICkit3 to the Bus Pirate PCB.

Note: You just need to connect the pin header to the PCB; there’s no need to solder it. Also, the last pin of the PICkit3 does not need to be connected.

_images/pickit3toBuspirate.jpg
  1. Select Device Family: In the software, go to “Device Family” and select “PIC 24.”
_images/PICDeviceFamily.png
  1. Detect the Controller: The software will automatically detect the controller on the PCB, and you will see the following screen:
_images/PICSelected.png
  1. Import Firmware: Import the firmware by selecting the “bpv3-BL44FW510-DUMP.hex” file from the firmware dump folder.
_images/ImportHexFile.png _images/HexFileImported.png
  1. Write Firmware: After importing the firmware, click the “Write” button to start writing the firmware to the controller. When the process is complete, you will see a “Programming Successful” message.
_images/ProgrammingSuccessful.png

Now the Bus Pirate is ready for further operations.

Bus Pirate Daughter Board Operation

  1. Load WiPhone with the “UARTPassthrough” firmware.

  2. Install the Bus Pirate daughter board on the back of the WiPhone.

  3. Connect WiPhone to the computer with a USB cable.

  4. On WiPhone, navigate to Tools -> Development -> UART Pass Through.

    _images/UARTPassThrough.png
  5. Set Baudrate to 115200 and press start.

    _images/UARTPassThroughApp.jpg

To get help or view a list of all commands, simply enter '?' at the prompt.

HiZ>?
General                                 Protocol interaction
---------------------------------------------------------------------------
?       This help                       (0)     List current macros
=X/|X   Converts X/reverse X            (x)     Macro x
~       Selftest                        [       Start
#       Reset                           ]       Stop
$       Jump to bootloader              {       Start with read
&/%     Delay 1 us/ms                   }       Stop
a/A/@   AUXPIN (low/HI/READ)            "abc"   Send string
b       Set baudrate                    123
c/C     AUX assignment (aux/CS)         0x123
d/D     Measure ADC (once/CONT.)        0b110   Send value
f       Measure frequency               r       Read
g/S     Generate PWM/Servo              /       CLK hi
h       Commandhistory                  \       CLK lo
i       Versioninfo/statusinfo          ^       CLK tick
l/L     Bitorder (msb/LSB)              -       DAT hi
m       Change mode                     _       DAT lo
o       Set output type                 .       DAT read
p/P     Pullup resistors (off/ON)       !       Bit read
s       Script engine                   :       Repeat e.g. r:10
v       Show volts/states               .       Bits to read/write e.g. 0x55.2
w/W     PSU (off/ON)            <x>/<x= >/<0>   Usermacro x/assign x/list all
HiZ>

There are numerous possibilities you can implement with bus pirate daughterboard. As an example here we will show how to do self test.

  • Disconnect any devices from the Bus Pirate I/O header pins.
  • Connect the Vpullup (Vpu) pin to the +5V pin and connect the ADC pin to the +3.3V pin.
_images/BusPIrateSelfTest.png
  • On WiPhone go to Tools -> Development -> UART Passthrough App. Set the baudrate to 115200 and press start.
  • To begin the self test, type '~' followed by enter in the serial terminal. Self-test is available in HiZ mode only.
_images/SelfTestTerminalOutput.png
HiZ> ~ <<< start self-test
Disconnect any devices
Connect (Vpu to +5V) and (ADC to +3.3V)
Space to continue <<< any key continues (really, try it)
Ctrl <<<control pin test
AUX OK
MODE LED OK
PULLUP H OK
PULLUP L OK
VREG OK
ADC and supply<<<analog pin test
5V(5.00) OK
VPU(4.89) OK
3.3V(3.34) OK
ADC(3.33) OK
Bus high<<<bus pin high check
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 0 <<<bus pin ground check
MOSI OK
CLK OK
MISO OK
CS OK
Bus Hi-Z 1 <<<bus pin pull-up check
MOSI OK
CLK OK
MISO OK
CS OK
MODE and VREG LEDs should be on!<<<pause to check LEDs
Any key to exit
Found 0 errors.
HiZ>

The self-test verifies that components connected to the PIC24FJ64GA002 respond as expected. This test was successful and found no errors.

For further details about the Bus Pirate, please refer to the Bus Pirate website .