MIDI and Arduino

Status
Not open for further replies.

Schiller

New Member
Hi there, i'm designing a midi input circuit. It would work with an Arduino Uno
i read carefully this post and the official midi hardware specs
Both resources have been very useful..

I would pose a question:

apparently, my midi input circuit works only with pin 4 (from midi connector) attached to pin 3 of the optocoupler
and pin 5 (from midi connector) attached to pin 2 of the optocoupler. So it works only if i invert the two connections between the midi port and the optocoupler

May this depends from using the circuit with Arduino?

Thanks for your attention...

 
If you're using a 6N138 opto isolator, pin 4 should connect to pin 2 of the opto with a 220R series resistor while pin 5 should connect to pin 3 of the opto directly. A backwards 1N4148 diode should be connected across pins 2 and 3 of the opto (cathode to pin 2, anode to pin 3).

If you're using a Sharp PC900, pins 1 and 2 on the opto should be used in place of pins 2 and 3 respectively.

If you're using any other opto besides these two, make sure the output of the opto is rated for a rise time of less than 2uS (high speed opto) as per the MIDI specification.

The data should not be inverted at the opto output as a low at pin 5 (current on) is a logic 0 while a high at pin 5 (current off) is logic 1. The opto output drops low when current is on while rising high when current is off. This is the correct polarity and no inversion is necessary.
 
Last edited:
Here is a schematic for a MIDI interface showing MIDI In, Thru, and Out ports. Uses a 6N138 high speed optoisolator on the MIDI In port.

The buffers on MIDI Out may/may not be necessary. They've been part of the MIDI hardware specification since the days of earlier processors that didn't have symmetrical source/sink currents and thus couldn't provide the current drive for the current loop. But the Thru port definitely needs it.

 

Attachments

  • MIDI.png
    15 KB · Views: 1,235
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…