Jump to content

PC-900 vs. 6N138


c0nsumer
 Share

Recommended Posts

pc900_vs_6n138.png

Hey everyone. I hope this is an okay place to ask this. What you see up above is a schematic for two MIDI inputs, one using a PC-900 optoisolator, the other using a 6N138. The one on top is from a schematic I'm reimplementing, and the bottom is from my MIDIbox SID-NUXX.

I believe that the two should be functionally equivilent, with each holding the MIDI IN line at +5V, and then MIDI data causing brief pulses before it returns back to 5V. (This is also what was observed on the scope.)

Just so I can rule out this portion of my design as being flawed, can someone confirm that these two will work similarly?

Thanks...

-Steve

UPDATE: Just to make things a bit clearer, I want to replace the top schematic with the bottom implementation. I'm looking for confirmation that it will work, or someone to tell me that I'm dumb and need to try again. And maybe a suggestion as to where I went wrong, if that's the case.

Link to comment
Share on other sites

1. 6N138 and 6N139 are the types which are suggested by MIDI.org

2. How about the speed of the PC-900... check the datasheet if it's fast enough

That's not really my question. I'm curious if you (and whomever else) agree that these are functionally equivalent electrically. I'm not trying to use a PC-900, I'm trying to replace one with a 6N138 and I'm wanting confirmation that this circuit will work as a replacement.

-Steve

Link to comment
Share on other sites

Steve,

The 6N138 schematic you're talking about, looks just like an "official" one I'm looking at here from the MBHP Core, so I guess you're good to go, as far as that's concerned. :)

I got hard up for an optocouple here myself a few weeks ago, and fought with a 6N136 or something, which never managed to work. There was a thread or two about using that here, where a pin was disconnected and a resistor value was changed, but it didn't work anyway. I think my 136(?) had already been sent to the next world. What I ended up with was a PC900 in "dead bug" mode (upside-down with jumpers wrapped around it). The PC900 re-mapping I have written down here was:

138    900

2  -  1

3  -  2

5  -  5

6  -  4

8  -  6

Your PC900 picture looks about the same. The only difference I see in mine here is that mine looks like there's a 5.6k resistance pulling up that fourth pin to the PIC (where yours has a 220). I don't know where my 5.6 came from. It's probably from the thread about using a 136. Either way, it sends and receives dumps OK, but that's about as close as it's gotten to being "tested".

Take Care,

George

PS- I realize your question is about switching to the 138 circuit, so yes (to me) the re-mapping of the pins looks right, as do the resistor values (judging by this core schematic). If anything else acts funky, make sure you check the connections to pins 4&5 of your DIN socket or whatever. I've accidentally reversed those two on stuff more times than I can remember here. :o

Link to comment
Share on other sites

The 6N138 schematic you're talking about, looks just like an "official" one I'm looking at here from the MBHP Core, so I guess you're good to go, as far as that's concerned. :)[/home]

Most of it was kinda borrowed from there, with other parts from other places. It seems to be a common implementation, though.

I... won't admit to having done that on the PCBs I had made for the project this is for. < hides >

But yes, I think the rest of it is proper, and it appears to be the same on the scope as what I'd seen with the MIDIbox input. (No, I don't have DSO so I can't say for sure... But I digress...)

I'm thinking my problem lies elsewhere. So, that means that it is now time to go home and try and figure out what. < sigh >

Ah well. Thanks again. :D

-Steve

Link to comment
Share on other sites

  • 7 years later...

This thread might be 8 years old - but here goes before anyone comes a cropper with propagation delays...

 

The PC900 is a digital opto-coupler - ie. if the input current to the emitting diode increases slowly, the output will snap from one state to the other when a threshold is reached.  As the input current decreases, the output will snap back at a lower level - so you won't get jittering at a critical level.  This is called 'hysteresis'.

 

Long cables (MIDI or otherwise) will slow up a signal, so a digital opto-coupler will square it up to maintain signal integrity.  Or so it should...

 

The problem with the PC900 is it's quite slow - and even worse it takes longer to react to a decreasing current than to an increasing one (typically 2us for increasing and 5us for decreasing).  Result: a skew where an original 50/50 square wave could become 60/40.

 

MIDI runs at 31.5kBd, ie. the time for one byte is typically 300us - so with the stop and start bits, each bit is only 30us.  A 3us skew is 10% of this, so if you daisychain several MIDI devices together, data arriving at the last risks being corrupted.  If the PC900's rise and fall times were the same, there wouldn't be a problem - nobody would notice a delay of milliseconds, let alone microseconds!

 

The 6N138 isn't digital at all.  It's a simple linear Darlington coupler, ie. the output current is (roughly) proportional to the input current.  This is translated to a voltage by your pull-up resistor (R6).  So you risk ringing, jitter and all sorts of signal corruption problems!

 

You need a fast digital optocoupler, such as the HCPL2200.  The rise and fall times are much shorter (typically 160ns and 180ns respectively), so there is negligible skew.

 

Although the maximum cable length in the MIDI spec. is 15m, I've successfully sent a signal down a 100m drum of cable as a trial before using MIDI in our theatre as a lighting control signal - the distance involved there is about 40m.

 

HTH

 

Steve G-S

Edited by stevegs
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...