The MIDI Physical Layer

MIDI at the hardware level is very similar to RS-232. The key similarities are:

  • both define hardware and protocol for serial data communication
  • The MIDI data frame (1 start bit, 8 data bits, 1 stop bit) is a subset of the data frames allowed by RS-232
  • both define a positive voltage/current to be a 'logical 0'.
    A negative voltage is a 'logical 1' for RS-232 (note 1)
    A zero current is a 'logical 1' for MIDI

MIDI data frame

The key differences are:

  • RS232 defines a voltage swing +/- 5 to 15 V
    MIDI defines a current swing 0 to 5 mA
  • RS232 has numerous standard baud rates 300,600...
    MIDI has a single baud rate 31250 baud (note 2)
  • The MIDI standard requires that an opto-isolator be used on the receiver circuit
    No isolation is required by RS-232
  • RS-232 defines handshaking signals in addition to the data signals
    MIDI does not use any handshaking signals
  • RS-232 uses a D25 connector
    MIDI uses a 2x 5-pin DIN connectors

 

 
  
MIDI vs RS232
 RS-232 MIDI
Frame Format 1 start bit
5-8 data bits
1-2 stop bits
optional parity bit
1 start bit
8 data bits
1 stop bits
no parity
Baud Rate up to 20k
standard rates of 300, 600,...19k2
extended rates of 38k4, 57k6, 115k2
31250 baud +/- 1%
Driver (loaded) Voltage:
Logic 0: +5V to +15V
Logic 1: -5V to -15V
Current:
Logic 0: 5mA
Logic 1: 0mA
Driver (open circuit) +/- 25V maximum Unspecified
Driver (short circuit) +/- 100mA maximum Unspecified
Receiver Load 3k to 7k ohm Opto-isolator
(otherwise unspecified)
Receiver Sensitivity +/- 3V < 5 mA to turn 'on'
Receiver input range +/- 3V to +/-15V Unspecified
Signal rise/fall speed
Maximum
Minimum

30V/us (max) slew-rate
Unspecified

Unspecified
2 us (max) rise/fall times
Maximum cable 2500pF (approx. 15m) 15m
Isolation Unspecified Opto-isolator on receiver circuit
Handshaking signals Transmitter: RTS, DTR
Receiver: CTS, DSR, DCD, RI
None
Physical connector D25 5-pin DIN (180 degree)

MIDI Standard Hardware

This is the Standard MIDI Hardware (as described in the MIDI specification).

Circuit diagram of MIDI hardware

MIDI Ports

There are 3 types of MIDI Port:

IN for receiving data going into the MIDI device
OUT for data coming out of the MIDI device (ie data generated by the device)
THRU is like a MIDI OUT, except that THRU acts as a repeater for the data on the MIDI IN port

Note that if a MIDI device is capable of sending MIDI data, it will appear on the MIDI OUT port, and never on the MIDI THRU port.

Some MIDI devices have a 'Soft THRU' option, which allows the MIDI IN data to be repeated on the MIDI OUT port.

MIDI Cable wiring

All MIDI cables are wired 'straight through' (as per the diagram).

Unused pins (1 and 3) should be left unconnected.

MIDI Cable diagram

MIDI System Cabling

Here is a cabling diagram of a typical MIDI system.

Typical MIDI system wiring

Note that MIDI OUT connects to MIDI IN.
MIDI THRU also connects to MIDI IN.

You should not connect OUT to OUT, or IN to IN, or OUT to THRU


Footnotes:

Note 1:
RS-232 defines a logical 1 to be a negative voltage of at least -3V, ie an input 0V is undefined. However, a 0V signal is usually interpreted as a logical 1, so a swing of 0 to 5V will generally give legible data
Note 2:
Many MIDI sound modules also have a 'serial' input, which accepts RS-232 input at 38400 baud

 Up Contents Next midi_messages.html