I am interfacing between arduino and MIDI devices.
Newer MIDI devices are likely to have 3.3 volts on the receive/transmit lines, whilst older devices 5 volts.
What happens if you connect a 5v device to a 3.3 volt device?
I am interfacing between arduino and MIDI devices.
Newer MIDI devices are likely to have 3.3 volts on the receive/transmit lines, whilst older devices 5 volts.
What happens if you connect a 5v device to a 3.3 volt device?
MIDI is not voltage based it is a 5mA isolated current loop. If you're transmitting using a 3.3V signal you need to change resistor values to maintain 5mA and if you're receiving with only 3.3V available you need to find an opto-isolator that will work on 3.3V. Otherwise nothing changes.
Basically, with properly designed equipment, the voltage makes no difference at all.
Steve
I see. When I measure the current there is way less than even 1mA. Does that seem correct?
The MIDI electrical specification was updated to version 1.1 in 2014 to include 3.3V signaling.
The familiar 2 x 220Ω resistors found in 5V MIDI transmitter circuits are reduced to typically 33Ω and 10Ω in 3.3V circuits as detailed in the attached specifications.
2014 MIDI V1.1 Specification.pdf (240 KB)
Yes i see that. thanks. But how much current does the circuit actually draw?
The current flowing out of pin 4, and back into pin 5 should be 5mA, when the correct load of 220Ω and the LED of an optoisolator is connected.
So, to summarize [and correct me if I'm wrong, because I'm learning, here, too ;)]:
Outside of the equipment enclosure [i.e. *down the MIDI cable*] it really doesn't matter if there is 3.3V or 5V in the box. All that matters is, there is enough current to drive the receiver's Opto Isolator -- and that is a nominal 5ma.
In other words, whether it's 5V or 3.3V is obfuscated by the resistor selection, which mandates the common [i.e. *backward compatible*] 5ma signal. So, a 5V derived signal, can drive a 3.3V receiver, and vice versa.
Am I right? Or am I right?!?
Odd way of phrasing it (resistor selection doesn't obfuscate anything) but that does pretty much describe how any isolated current loop system (like MIDI) works.
Steve
slipstick:
Odd way of phrasing it (resistor selection doesn't obfuscate anything)
You're right -- Norm Crosby moment -- perhaps I was reaching for "Obscure". ;D
I can't measure 5mA. There seems to be much less than that.
tim77777:
I can't measure 5mA. There seems to be much less than that.
I'm not fully up on the MIDI protocol, but I seem to remember something about a timing signal [might only be sent by a sequencer] but when you measure this current, perhaps the signal is transitioning, presumably between 5mA and 0mA. If it's mostly 0mA, with periodic transitions, that might explain your insufficient current reading.
tim77777:
I can't measure 5mA. There seems to be much less than that.
This is because when the MIDI line is set at the idle state it draws no current.
Then when you send a MIDI message the current draw fluctuates between no current and 5mA depending if the serial is transmitting a zero or one at this time.
If you are trying to measure this with a DVM you have two problems:-
The current you will see is an average current which will depend on the message contents and the number of messages you will transmit per unit time.
Your DVM probably won't measure such rapid pulses anyway.
To measure the current you need an oscilloscope, measure the voltage across the series resistor and do the sums.
I see. will do, thanks.
Should there be a diode input clamp on the transmit line, to protect the uart pin on the microntroller.
tim77777:
Should there be a diode input clamp on the transmit line, to protect the uart pin on the microntroller.
It is not needed because the transmitter only ever sees the LED and seriese resistor from the equipment it is connected to.
You have to watch however that the 3V3 signal pin can provide the appropriate amount of current, some processors are limited in the source current certain pins can supply. It has to cope with the current required if the signals are swapped over, that is the resistor is in seriese with a diode and not an LED.
Great. It can sink and source 50mA, so that should be adequate