A very basic bus sniffer and communicator (UART, SPI, I2C, etc). A simplified (and cheaper) version of the Bus Pirate.
This circuit can be used to either sniff communication between components (such as microcontrollers), or to directly communicate with the components using the computer.
- Supported input/output formats: ASCII, hexadecimal, decimal and binary
- Supported protocols:
- UART (with or without hardware flow control)
- Baud autodetect
- SPI (master, slave, sniffing)
- I2C (not implemented yet)
- PWM output
- UART (with or without hardware flow control)
- Supported I/O voltages: 3.3V and 5V
Connect the Pico USB to the computer, and then open a serial terminal to the USB port at 115200 baud.
- General
use [ uart | spi_master | spi_slave | spi_sniff | pwm ]
reset
(reset all options to default)set
(print all variables)
- UART
set uart.baud [NNN]
(default: 115200)set uart.mode [MMM]
(default: 8N1)set uart.hflow [on | off]
(default: off)set uart.output [ascii | dec | bin | hex]
(default: ascii)use uart guess
: tries to autodetect baudrate
- SPI
set spi.cpol [0 | 1]
(default: 0)set spi.cpha [0 | 1]
(default: 0)set spi.order [lsb | msb]
(default: msb)set spi.baud [NNNN]
(baud rate in Hz, master only, default: 100000)set spi.autorespond [off | NN]
(always respond with byte NN, default off)set spi.output [ascii | dec | bin | hex]
(default: hex)
- I2C
set i2c.baud [NNNN]
(baud rate in Hz, master only, default: 100000)set i2c.output [ascii | dec | bin | hex]
(default: hex)use i2c scan
: scan for connected slave addresses
- PWM
set pwm.freq [NNNN]
(frequency in Hz, default: 100000)set pwm.duty [NN]
(% duty cycle, default: 50)
Press CTRL+C
to end communication with a protocol at any time.
Settings are saved on flash, and persist after a reboot.
Communication example:
BP pin | UART | SPI master | SPI slave | SPI sniff | I2C function | PWM function | RPi Pico pin |
---|---|---|---|---|---|---|---|
COMM0 | TX | MISO | MOSI | RX0 | SDA | PWM0 | GP0 (1) |
COMM1 | RX0 | CS | SS | SS | SCL | GP1 (2) | |
COMM2 | CTS | SCK | SCK | SCK | GP2 (4), GP10 (14) | ||
COMM3 | RTS | MOSI | MISO | GP3 (5) | |||
COMM4 | RX1 | RX1 | GP5 (7), GP8 (11) | ||||
GND | GND |
This section is mandatory - it provides the computer interface, and allows communicating with components at 3.3V.
This section is optional, and allows for communicating with 5V devices as well.
This section is optional, and adds blinking lights to communication channels to indicate activity.
To update the firmware:
- Download the file
poor-man-bus-pirate.zip
and uncompress it. - Connect the Raspberry Pi Pico via USB to the computer while pressing the
BOOTSEL
button. - This will create a USB mount. Copy the file
poor-man-bus-pirate.uf2
into that directory. - Restart the Pico.
This is the circuit I implemented for my personal use: