Jump to content

Understanding circuits - MIDI-IN diode and resistor before optocoupler


verpeiler
 Share

Recommended Posts

From time to time I try to understand the circuits I'm soldering. In most cases I fail already at  really simple things...

 

Lets take a simple MIDI-IN. Whats the purpose of the 220Ohm resistor (R7) and the diode (D1). I know this is in the MIDI-specification but what exactly are they intend for?

 

post-5361-0-75504000-1383609528_thumb.pn

 

I guess the diode should do some kind of polarity-protection.  But inside the 6N138 between pin 2-3 is already a diode (in the other direction) and this LED will light up if the polarity is right and not if the polarity is wrong. And the resistor should limit the current in case of a short circuit? If so where could a short circuit come from in this case?

 

 

Edited by verpeiler
Link to comment
Share on other sites

My assumptions: the 220 Ohm resistor is a common pre-resistor for the LED, e.g. for the case that somebody drives the input directly with 5V (by fault) without protection resistors at the MIDI OUT side (which also have the purpose to protect against short circuits).

 

The 1N4148 diode: well, first it has to be considered, what happens when signals are transferred over long cables with some R, L and C (a so called Transmission Line)

 

While the signal might look like a common digital signal, toggling between 0V and 5V (resp. 3V) at the source (*), it could look totally crazy at the sink (optocoupler) depending on the cable length.

 

Here an extreme example (it's not a MIDI signal, but I just want to illustrate what could happen):

8_sclk_superlong_wire_wo_termination.jpg

As you can see, the signal can get negative transients below 0V, and positive transients above Vcc

 

Now let's have a look into the Datasheet. It lists a maximum reverse input voltage of 5V, means: if the signal spikes below -5V, the internal emitter diode could be destroyed.

 

I'm unsure if the emitter is in real danger (and I don't want to try this out), but if you compare with the reverse voltage of a 1N4148 diode (75V), you can see the difference - safety first! ;-)

 

Best Regards, Thorsten.

 

(*) not considering, that a MIDI OUT should normally configured in open drain mode, but that's another story - especially since not all MIDI devices use this mode, but push-pull instead.

 
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...