fbpx
Skip to main content

MIDI Forum

MIDI electrical spe...
 
Notifications
Clear all

MIDI electrical spec - logic low level

4 Posts
3 Users
0 Reactions
20.5 K Views
Floppy
Posts: 2
New Member
Topic starter
 

Hi. If possible, I would like some clarification on the MIDI electrical specifications.

The calculations presented in both the original and revised 2014 spec to calculate the loop current seem to assume the output buffer is able to drive down to 0 volts. In the event the output buffer has a higher logic low level (for example, 0.4V TTL logic low), the current in the loop will be reduced significantly below the required 5mA minimum. As the 2014 specification quite rightly points out, there are MIDI devices which require the full 5mA worst-case to turn on.

I have looked at a number of commercial implementations of MIDI output buffers, and they vary enormously in their logic low level. Some devices use a PNP emitter follower, which could produce a logic low level as high as 1.1V. Other devices use an NPN common-emitter configuration with a low level around 0.1V.

What is the recommended course of action to compensate for a non-zero logic low level? Should the 220 ohm resistors (or 33 ohm in a 3.3V circuit) be reduced to maintain a 5mA absolute minimum current? Or is any compliant MIDI receiver expected to be able to accept loop currents lower than 5mA which might result from a 0.4-0.8V logic low level? Is there a defined required minimum logic low level?

 
Posted : 19/02/2018 3:08 pm
Geoff
Posts: 1043
Noble Member
 

Oh?

Interesting.

Clearly there is some variation in the implementation of the low level midi circuitry.

Does this matter?

As far as I can recall, I have never heard or seen any reference to any case where midi device X would not work with midi device Y, regarding the transfer of midi data (bits and bytes). If there WAS such a case, was the low level midi circuitry to blame, as per the parameters of the original question?

Geoff

 
Posted : 19/02/2018 4:39 pm
Floppy
Posts: 2
New Member
Topic starter
 

As far as I can recall, I have never heard or seen any reference to any case where midi device X would not work with midi device Y, regarding the transfer of midi data (bits and bytes). If there WAS such a case, was the low level midi circuitry to blame, as per the parameters of the original question?

I think in the vast majority of cases it will work reliably - because at room temperature with average components, the threshold current and logic low level of the relevant parts are significantly better than the worst-case specified in the datasheet. But that's no guarantee, and compatibility problems could arise.

I have heard of people needing to replace opto-isolators in MIDI gear, although I haven't personally needed to do this. I wouldn't be at all surprised if the "faulty" part was in fact not faulty at all, merely marginally specified. Opto-isolators suffer degraded CTR as they age. If you use a PC900 as the original specification suggests, there is enough headroom to allow for this. But if the designer has opted for a 6N137 having followed the advice that the opto must turn on with no more than 5mA, it could simply cease working after a time. I have seen several pieces of (poorly-designed) MIDI gear with 6N137s.

The 2014 specification seems to address this in the low voltage amendment by specifying a much higher loop current. However, the 5V specification remains unchanged.

Neither the original MIDI spec nor the 2014 revision give what I would consider sufficient detail on the electrical interface. Important implementation details are left entirely up to the designer, giving rise to potential compatibility problems.

In addition to this, there are many MIDI devices which deviate significantly from the specification. I have seen violation of the baud rate tolerance (+/- 1%), and the use of unusual resistor values (150 ohms for the opto-isolator input, and 47 ohms on a 3.3V output - the latter was a design by Yamaha). I've also seen a commercial design that drove +/- 12V signalling on the MIDI output.

As far as I can see, the MIDI spec document conflicts with itself. The requirement for an opto-isolator that turns on at 5mA is not compatible with the original specification calling for the use of a 5V supply and 220 ohm resistors. Even the revised 3.3V specification does not entirely fix the problem. They admit in the specification document that under marginal conditions the 5mA threshold will not be met. Their response to this is: "It is not clear, however, that 1.9V can be achieved with only 4.472 mA drive, as the maximum forward drop occurs at the highest current. If the forward drop decreases, the current through the resistors increases."

I do worry when I read phrases like "it is not clear" in an important part of a specification document.

 
Posted : 19/02/2018 5:45 pm
Clemens Ladisch
Posts: 323
Reputable Member
 

The calculations presented in both the original and revised 2014 spec to calculate the loop current seem to assume the output buffer is able to drive down to 0 volts. In the event the output buffer has a higher logic low level (for example, 0.4V TTL logic low), the current in the loop will be reduced significantly below the required 5mA minimum.

The 0.4 V limit is specified for 16 mA and the highest temperature. The output transistor's saturation voltage diminishes with current:

And at more realistic temperatures, the output will be somewhere below 0.2 V, which is not a significant drop.

Some devices use a PNP emitter follower, which could produce a logic low level as high as 1.1V.

An emitter follower has almost no base current, so it produces a level of about 0.7 V. And that voltage drop must be compensated for by adjusting the resistors (220 Ω + 100 Ω should be around right); using an emitter follower with 2× 220 Ω would indeed be wrong.

What is the recommended course of action to compensate for a non-zero logic low level?

To do nothing. The circuit was already designed to work with 0.2 V.

I have heard of people needing to replace opto-isolators in MIDI gear, although I haven't personally needed to do this.

As far as I have seen, this happens only with phototransistor isolators, where a too-high CTR would make it too slow.

Opto-isolators suffer degraded CTR as they age.

But not in MIDI receivers. Aging is caused by electromigration, which happens at high currents and high temperatures.

Nobody bothers to measure aging at 5 mA. At 10 mA, with the worst LED material that I could find, the worst 0.1 % samples need 10,000 hours to reduce CTR to a 95 % level:
(See below; this CMS appears to eat some images.)
And consider that MIDI is idle more than 99 % of the time, so we end up with more than 100 years.

But if the designer has opted for a 6N137 having followed the advice that the opto must turn on with no more than 5mA, it could simply cease working after a time.

The 6N137's 5 mA threshold is specified for the entire range of temperatures and load resistors. MIDI does not need 10 Mbit/s, so in practice, a pullup between 1 kΩ and 10 kΩ is used, which gives more headroom:

(Using the 6N137 with a 270 Ω load resistor would be a bad thing.)

I have seen several pieces of (poorly-designed) MIDI gear with 6N137s.

Then what are you going to say about the Roland R-8? :p

(Well, they removed R109 in the MkII.)

The 2014 specification seems to address this in the low voltage amendment by specifying a much higher loop current.

With 3.3 V, the typical loop current is higher only to ensure that it is at least 5 mA in the worst case.

[…] 47 ohms on a 3.3V output - the latter was a design by Yamaha

That's perfectly fine if you make different assumptions, e.g., tighter tolerances on the 3.3 V supply.

And I don't know where that 1.9 V came from. It's probably the worst case at −40 °C, i.e., not applicable for MIDI devices.

They admit in the specification document that under marginal conditions the 5mA threshold will not be met. Their response to this is: "It is not clear, however, that 1.9V can be achieved with only 4.472 mA drive, as the maximum forward drop occurs at the highest current. If the forward drop decreases, the current through the resistors increases."

I do worry when I read phrases like "it is not clear" in an important part of a specification document.

No datasheet has guaranteed limits for the specific values that MIDI uses, so the best you can do is to estimate. The Yamaha designer obviously thought that the specification's assumptions were too pessimistic.

 
Posted : 13/05/2018 2:34 am
Share: