ChipCenter Questlink
SEARCH CHIPCENTER
Search Type:
Search for:




Knowledge Centers
Product Reviews
Data Sheets
Guides & Experts
News
International
Ask Us
Circuit Cellar Online
App Notes
NetSeminars
Careers
Resources
FAQ
EE Times Network
Electronics Group Sites

A WELL-LIT SOUND CHECK


Circuit Cellar Online
THE MAGAZINE FOR COMPUTER APPLICATIONS
Circuit Cellar Online offers articles illustrating creative solutions
and unique applications through complete projects, practical
tutorials, and useful design techniques.

A WELL-LIT SOUND CHECK

Lessons from the Trenches Understanding the PC's MIDI Interface
by Stuart Ball

Start ı How Does MIDI Work? ı How the Circuit Works ı Sources and PDF

HOW DOES MIDI WORK?

The MIDI interface is serial, current loop, and optically isolated. The transfer rate is 31,250 bps, and the current level is 5 mA. A 1 is represented by no current flow, and a 0 is represented by current. This may seem backward, because most current-loop schemes define no current flow as the zero state, but it makes sense for MIDI. If the no-current condition was a logical zero, then an unconnected MIDI input would see a continuous stream of data bytes containing all zeros.

Except for the transfer rate, MIDI data is in standard asynchronous serial format, with a zero start bit, eight data bits, and a stop bit. Because the transfer rate is not one of the RS-232 standard rates, the existing communication ports in your PC are not suited for MIDI use.

Do you need to catch up on the first
11 years of Circuit Cellar?

Or do you just want easy access
to all your favorite articles?

We have all 11 years available on CD in PDF format along with all of the code for each article.
Order the first 11 years of
Circuit Cellar magazine on CD!

 

The MIDI connector is a circular 5-pin DIN, exactly like the one used to connect the keyboard to many PCs. Of course, the signals on the MIDI connector are completely different from those used by your computer keyboard. Although the MIDI connector has five pins, only two pins and a shield connection are actually used.

The MIDI interface on each connector is unidirectional, and a typical MIDI device will have a MIDI IN and a MIDI OUT. Some devices have a MIDI THRU that buffers and passes on the MIDI IN data.

For a single instrument connected to a computer, MIDI IN on the instrument connects to MIDI OUT on the computer, and vice versa. Multiple instruments can be daisy chained together and controlled from a single computer. This is done by connecting MIDI OUT from the computer to MIDI IN on the first instrument. Then, MIDI OUT on one instrument connects to MIDI IN on the next. MIDI OUT on the last instrument connects to MIDI IN on the computer.

The current loop, optically isolated characteristics of MIDI provide noise isolation and protection against ground loops and other grounding problems.

WHERE IS MIDI?

By now, you may be wondering where these large 5-pin connectors are on your soundcard. A typical soundcard has jacks for microphones and speakers, a 15-pin joystick connector, and maybe a header for an internal CD-ROM drive. There arenıt 5-pin connectors of any kind, especially anything as obvious as a 5-pin DIN.

The answer is that the MIDI input and output signals are placed on two pins of the joystick connector. As you can see in Figure 2, the joystick connector has a number of pins dedicated to 5 V and ground. Soundcard manufacturers that include a MIDI port (not all cards do) take two of these power pins (12 and 15) for MIDI input and MIDI output.

Figure 2ıThe gameport connector is a DA-15 type. Pins 12 and 15, which were 5 V and ground on the original IBM PC gameport, are used for the MIDI signals on soundcards that support external MIDI.

 

One important fact about the MIDI signals on the soundcard is that they are TTL/CMOS logic levelsınot ready for connection to the current-loop signals that the rest of the MIDI world expects to see.

You can buy interface cables that convert the MIDI signals on your soundcard for use with a MIDI device. These cables have four connectorsıa male DA-15 to plug into the computer, a female DA-15 for the joystick, and two 5-pin MIDI connectors. These work, but they provide no indication of whether or not everything is working.

Figure 3 shows the schematic of a soundcard to MIDI interface with indicator LEDs. MIDI TX from the computer drives the MIDI OUT connector, and data on the MIDI IN connector is isolated and buffered to drive the MIDI RX to the computer. There is one LED to indicate activity on MIDI IN and one for MIDI OUT.

Figure 3ıD2 and D3 are LEDs that indicate MIDI activity.

(click here for figure)

 

In Figure 3, a 16-pin header gets the MIDI signals from the computer. A ribbon cable with a DA-15 male connector at one end and a DA-15 female at the other acts as a joystick extension cable, letting you connect both the MIDI adapter and your joystick at the same time. The DA-15 male connects to the computer gameport connector, and the DA-15 female connects to your joystick. A 16-pin IDC connector in the middle of the ribbon cable connects to the MIDI-to-soundblaster adapter.

PREVIOUSNEXT


Circuit Cellar provides up-to-date information for engineers. Visit www.circuitcellar.com for more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com or subscribe online. ıCircuit Cellar, the Magazine for Computer Applications. Posted with permission.
Click here to get your listing up.

Copyright © 2003 ChipCenter-QuestLink
About ChipCenter-Questlink  Contact Us  Privacy Statement   Advertising Information  FAQ