Skip to main content

UART Protocol Commands

Overview

  • Bus: UART, MIDI (universal asynchronous receiver transmitter)
  • Connections: two pins (RX/TX) and ground
  • Output type: 1.65-5volts. Powered by onboard supply or an external voltage on the VOUT/VREF pin
  • Maximum Voltage: 5volts
info

UART is also known as the common PC serial port. The PC serial port operates at full RS232 voltage levels (-13volts to +13volts) though, which are not compatible with the Bus Pirate.

Configuration options

Bus Pirate [/dev/ttyS0]
UART speed
1200, 2400, 4800, 19200, 38400, 57600, 115200 etc
x. Exit
Baud (115200*) >
Data bits
5 to 8 bits
x. Exit
Bits (8*) >
Parity
1. None*
2. Even
3. Odd
x. Exit
Parity (1) >
Stop bits
1. 1*
2. 2
x. Exit
Bits (1) >
Actual speed: 115207 baud
Mode: UART
UART>

Syntax

CommandDescription
[Open UART, use r to read bytes.
{Open UART, display data as it arrives asynchronously.
] or }Close UART.
rCheck UART for byte, or fail if empty. (r:1…255 for bulk reads)
0bWrite this binary value. Format is 0b00000000 for a byte, but partial bytes are also fine: 0b1001.
0xWrite this HEX value. Format is 0x01. Partial bytes are fine: 0xA. A-F can be lower-case or capital letters.
0-255Write this decimal value. Any number not preceded by 0x or 0b is interpreted as a decimal value.
spaceValue delimiter. Use a space to separate numbers. No delimiter is required between non-number values: {0xa6 0 0 16 5 0b111 0xaF rrrr}.
(#)Run macro, (0) for macro list.

Macros

Macro list

NumberDescription
0Macro menu
1Transparent UART bridge. Press the Bus Pirate button to exit.
2GPS NMEA sentence decoder. Press any key to exit.

Transparent UART bridge

UART mode macro (1) opens a simple serial->USB bridge. To exit, press the button on the Bus Pirate.

GPS NMEA sentence decoder

Most GPS modules output NMEA sentences through a serial UART. Macro (2) decodes common sentences using minmea. The raw data and decoded data are printed in the terminal. Press any key to exit.

MIDI

MIDI is a command set used by electronic (music) instruments. It travels over a standard serial UART configured for 31250bps/8/n/1.

MIDI is a ring network, each node has an input and output socket. Each node passes messages to the next in the ring. The input and outputs are opto-isolated. The signaling is at 5volts, 5ma (current-based signaling). An adapter is required: example 1, example 2.

Connections

Bus PirateDirectionCircuitDescription
TXRXBus Pirate Transmit
RXTXBus Pirate Receive
GNDGNDSignal Ground

Connect the Bus Pirate transmit pin (TX) to the UART device receive pin (RX). Connect the Bus Pirate receive pin (RX) to the UART device transmit pin (TX).