VOGONS


Reply 40 of 57, by stamasd

User metadata
Rank l33t
Rank
l33t
keropi wrote:
You can even build a simple midi-out adapter yourself with a 74LS00 ic, here is a schematic: […]
Show full quote

You can even build a simple midi-out adapter yourself with a 74LS00 ic, here is a schematic:

sb_midi-out_zpstt7npiuy.png

it is enough to get sound out of DOS games as the only thing you need is the midi-out from the DB15 joystick port.

Oh, no optocoupler? I'm shocked! (literally) 😀

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 41 of 57, by keropi

User metadata
Rank l33t++
Rank
l33t++

Why would you need an optocoupler for the midi-out port? The full schematic does use one for the midi-in port but this specific schematic is edited and shows only the needed parts for the midi out port

🎵 🎧 PCMIDI MPU , OrpheusII , Action Rewind , Megacard and 🎶GoldLib soundcard website

Reply 42 of 57, by Great Hierophant

User metadata
Rank l33t
Rank
l33t

I assume that the IC in the above schematic is used as a buffer, since if you transmit a "0" you will end up with a "0" and likewise a "1" for a "1". You could use a 74LS04 just as well.

http://nerdlypleasures.blogspot.com/ - Nerdly Pleasures - My Retro Gaming, Computing & Tech Blog

Reply 43 of 57, by stamasd

User metadata
Rank l33t
Rank
l33t
keropi wrote:

Why would you need an optocoupler for the midi-out port? The full schematic does use one for the midi-in port but this specific schematic is edited and shows only the needed parts for the midi out port

It was a joke. 😒

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 44 of 57, by keropi

User metadata
Rank l33t++
Rank
l33t++

yeah the 74LS00 is indeed used as a buffer...
didn't get the joke it stamasd , I thought it was a genuine comment 🤣 🤣 🤣

🎵 🎧 PCMIDI MPU , OrpheusII , Action Rewind , Megacard and 🎶GoldLib soundcard website

Reply 46 of 57, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++

The NAND gates provide the current loop with a supply of known low impedance and the voltage output of the sound card with a safe, high impedance load. The impedance of the sound card output is not necessarily specified, therefore current in the loop is not necessarily controlled without buffering.

All hail the Great Capacitor Brand Finder

Reply 47 of 57, by coldturkey

User metadata
Rank Newbie
Rank
Newbie

Sorry to bring up an older thread, but there are instances where you don't need the buffer if the sound card specs are close. Since the midi transmitter basically flips between an open connection and a closed connection, the sourcing voltage of the TX line of the sound card only needs to be relatively close to 5 volts so that both TX and the 5 volt supply are near the same potential and you have an open circuit. The sinking capabilities are where it counts, and it only needs to sink a relatively small amount of current (basically what's being loaded by all the in-line resistors plus that LED in the receiver circuit). For a good reference on the midi circuit: https://learn.sparkfun.com/tutorials/midi-tut … -implementation

No doubt the buffer ensures that your UART doesn't have to be a great sink, but I built an even simpler cable based on the wikipedia midi spec and the spec provided by Anders M Olsson in the MT32SB documentation for his Sierra SoundBlaster MT32 driver. Basically it's just the 220ohm resistors tied to the Tx and 5volt lines of the joystick ports. Testing with my SB Audigy transmitting into a Roland UM-ONE MK2 has been perfect, and I'm going to try with a Sound Blaster Pro 2 soon as well. My guess is that Creative Labs likely ensured that the push-pull capabilities of the UART were enough to deal with the midi spec, though a buffer obviously provides a bit more protection to the UART if it isn't already buffered (and who knows, it may actually be). It may be worth a try if you can't easily source a buffer, though I guess the disclaimer is to try at your own risk.

Here's Anders circuit, which is dead simple:
anders.png
and here's the Wikipedia one (pay attention only to the Tx portion, which is identical to Anders):
midi.png

CT

Reply 48 of 57, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++

The buffer is not for additional sinking or sourcing capability. It's to provide a standard level of impedance for the current loop as well as optionally providing isolation between devices. A simplified adapter will sometimes work, but a buffered circuit will reliably work with more devices.

All hail the Great Capacitor Brand Finder

Reply 49 of 57, by coldturkey

User metadata
Rank Newbie
Rank
Newbie

Hi gdjacobs,

I'm still trying to fully comprehend midi, so I appreciate the feedback. In regards to source/sink, I thought they related to the midi spec in terms of ensuring the correct potential when Tx goes high and low (and subsquently ensuring that the Tx line can sink enough current to light the LED)? I've been doing an incredbile amount of reading on the spec, and it sounds like the concern was that the potential of the Uart's Tx line may not be exactly ground when it goes low and not close enough to 5volts when it goes high. The buffer is supposed to take these levels closer to supply ground and supply voltage respectively. Since the impedence of the current loop is defined by the resistors and the LED in the circuit, I haven't been able to find anything in terms of the buffer further defining the circuit impedence. Certainly the input impedence of Tx and its potential when it goes low need to be such that the appropriate amount of current can flow through the circuit though.

Any further insight you could provide me would be greatly appreciated.

Kindest regards,

CT

Reply 50 of 57, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++

As signaling for MIDI is via a current loop with binary high-low current levels, the suggested circuit configuration is less about defining potentials and more about delivering and detecting either 0 or 5 mA. In a way, what you are saying is correct. If the uart has a non-trivial series impedance, the voltage between the uart and rail pins could depart significantly from 0 and 5V (or whatever the ideal voltage is). The key, however, is not the reliability of the driver voltage (which is in fact not specified in the standard), but the resultant reliability of the signal current.

All hail the Great Capacitor Brand Finder

Reply 51 of 57, by coldturkey

User metadata
Rank Newbie
Rank
Newbie

This post has been edited to try and be more accurate:

That’s right, it is really all about delivering current! I think where I get fixed on potential (as do most of the articles about Midi such as the sparkfun one I linked to earlier) is that when you look at the diagram on the Midi spec page, they show you how to achieve 0ma and 5ma using specific resistors with a 5volt source plus a buffer capable of pushing the line close to 5 volts and pulling it close to 0 (since Ohm's law requires us to know potential and impedance in order for an exact current draw).
midihw.gif
https://www.midi.org/specifications/item/midi … l-specification

Based on the Midi reference circuit, there are 3 220ohm resistors (660ohm series impedance) plus some amount of impedance for the LED in the opto-coupler (Edit: a trivial amount actually). With a forward voltage around 1.1 volts on the LED in the opto-coupler (assuming a Sharp PC-900) we can calculate remaining voltage over the resistors as 5v - 1.1v = 3.9v. Then applying Ohm’s law (i=v/r) the circuit draws (3.9volts/660ohms) = 5.9ma when closed (ie. very close to spec, and likely closer if Tx does not fully go to 0volts when low).

After downloading the Midi spec:, There is freedom to choose a different opto-coupler as long as the resistance on the Midi In part of the loop compensates for it. This means that the transmitter side could likely use different potentials and resistances than shown in the spec if the resistor value and the LED forward voltage in the Midi In part of the loop are known. Considering that the Midi In is a black box on any connection you haven't made yourself, I would say that sticking to the spec helps to guarantee that it will work.

So I guess the designer of the post uart transmitter electronics (which is us in this case) needs be fully aware of what voltage we are supplying to DIN pin 4 and what voltage Tx swings between when high and low. We can then add the appropriate resistors to the transmitter side of the loop to ensure we only pull 5ma at Tx low (assuming we know what they used for an opto-coupler and resistor for Midi In, otherwise there are still no guarantees it will work). If we don't know anything about the Midi In side of the current loop and/or the soundcard manufacturer won’t provide us the specs on the Tx gameport pin, then it really comes down to pure luck as to whether it will be reliable, or even work, if we don't use a buffer and just throw some resistors on the pins. I guess I’m lucky that my Audigy works so well without a buffer given that I know nothing about the electrical characteristics of the Tx pin and just put in 220ohm resistors on pins 4 and 5.

Many thanks again for your help here!!

PS – I see Bob and Doug as your avatar, so I want to wish you a happy belated Canada Day!

Last edited by coldturkey on 2016-07-04, 01:40. Edited 3 times in total.

Reply 52 of 57, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++

Thanks!

One small correction: LEDs (and any diodes in general) have very small parasitic impedances which can be neglected in the approximate, but they do have a significant voltage drop across the semiconductor junction. This drop is so slightly current dependent that it could be considered constant. For example, silicon junctions are usually about a 0.7V drop.

For loads usually typical in TTL circuits (100s of ohms), I treat LS series chips as stiff voltage sources. Not enough power for you? You can always implement a buffer using a TO-220 transistor! Bonus points for current control using feedback.

All hail the Great Capacitor Brand Finder

Reply 53 of 57, by coldturkey

User metadata
Rank Newbie
Rank
Newbie

Thank you again. Once I understand how the LED impacts the circuit, I'll correct my post above. Do I substract the forward voltage from the source voltage (pc-900 drops about 1 volt), and then calculate circuit current? Ex) 5volt source - 1 volt drop from LED / 660ohm series resistance = 6ma?

Kind regards,

CT

Reply 54 of 57, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++

http://conceptselectronics.com/diodes/diode-e … ivalent-models/

If it helps until you become used to it, you can draw an equivalent circuit.

All hail the Great Capacitor Brand Finder

Reply 56 of 57, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++

I think your summary makes things more clear than if I would have written it, actually. Teamwork!

53c0790b40514.jpg

Notice also that most of the impedance is on the supply side of both the MIDI in and MIDI out circuits. The single 220 ohm resistor in series with the diode is most likely to protect the opto-coupler from user stupidity.

All hail the Great Capacitor Brand Finder