Generic Midi interface 1 Specifications A Midi interface is the hardware connection between two Midi devices. Only digital information describing which note is to be played is transferred by Midi. The actual audio signal is carried by separate cables. To avoid ground loops, the Midi interfaces of the devices are electrically isolated. An electronic device called an optocoupler is used to achieve the isolation. The optocoupler translates the incomming electrical-signal into light and then it translates the light-signal back to an electrical-signal. 1.1 Serial protocol The Midi interfacing standard uses a 31.25kHz baudrate. For Midi, the parity must be set to NONE, the number of stop bits must be set to 1 and finally the number of data-bits must be set to 8. For Intel-like devices like the 8252 UART or the 8031 micro-controller it is difficult to combine the Midi baudrate with 'normal' baudrates like 9600 baud. 1.2 Hardware requirements A Midi interface is a current-loop type interface. The current is approx. 5mA. The advantage of useing a current loop lies in the fact that a current flow is less sensitive to noise than a voltage-level signal, like RS232. 2 How to make a Midi interface for your project The UC_MIDI.GIF contains the schematics of a receive and a send circuit. For an Midi-thru option I refer to the Amiga interface which is explained in another place on this WEB-site. The numbers placed near the wires in the schematics are the pin-number of the DIN plugs. 2.1 Send circuit The top circuit shows the schematic of a typical send circuit. The output of the UART (=Universal Asynchronous Receiver Transmitter=serial interface) can be either a TTL totem pole output or an open collector output. In either case the TXD output will sink the current floating through the interface. Sinking the 5mA is no problem for any TTL-compatible output. 2.2 Receive circuit The receive circuit consist of 2 resistors and an optocoupler. In some circuits, which I've seen floating around on the net, a 6N138 optocoupler is used. Personally I prefer to use the 6N136 (when working with standard TTL) over the 6N138 because the configuration with the 6N136 consumes nearly 9 times as less power. The reverse biased diode across the LED of the optocoupler is not really necessary, but highly recommended. This diode blocks reverse voltages which may be higher than the reverse blocking voltage (=30V at max!) of the LED in the optocoupler. 3 Comments If you have any questions or suggestions please feel free to email me at: nctnico@cistron.nl