Midi In and Out - 3.3v ~ Let me know if I did it right

Status
Not open for further replies.

dimitre

Well-known member
Midi in is actually working! Please let me know if I mounted it right, the diode position, etc.
Thank you

IMG_9538.jpg
midi_if.gif
Screen Shot 2017-03-29 at 12.13.02 PM.png
 
I don't see a resistor from pin 4 but the signal diode looks to be reverse biased as it should.
 
Last edited:
Hi guys, I'm making a midi interface too and I have a doubt but for the output..
For the midi spec, with 3.3v, there should be a 10ohm 0.25w resistor from UART to pin 5 and 33 ohm 0.5w from v+ to pin 4 but from page: https://www.pjrc.com/teensy/td_libs_MIDI.html 47 ohm resistors (both) are suggested.

So, which one is better with teensy 3.2 ?
Thanks,
Daniele.
 
Either will work.. 10 Ohm and 33 Ohm are the official MIDI spec but I think Paul posted 47 Ohm for both before that spec was available.
 
I would not recommend following the advice from that blog. There is very little difference between using two 47 ohm resistors versus 10 and 33 ohms. But using 220 and running the transmit pin directly to the cable without any resistor is not good. 5.6K for the pullup is also not good advice. These may work some times, but they are far outside the recommended range.
 
But even though it's 'wrong' it likely still works with most configurations... the receiving circuitry is pretty resilient to current variation on most receivers.


I'm not sure what spec you're referring to for the diode but it's just there for a bit of polarity protection so I think that's OK.

I'm not an EE... but I think both Paul's and the MIDI spec are fine... I'd go with MIDI because it is the standard.

(Ah ...someone that does know got here first... )
 
Last edited:
I would not recommend following the advice from that blog. There is very little difference between using two 47 ohm resistors versus 10 and 33 ohms. But using 220 and running the transmit pin directly to the cable without any resistor is not good. 5.6K for the pullup is also not good advice. These may work some times, but they are far outside the recommended range.
I suspected it... asked just to be sure.

I'm not sure what spec you're referring to for the diode but it's just there for a bit of polarity protection so I think that's OK.

The optocoupler 6n137..
I guess the answer ;)

Thanks guys !
Daniele.
 
I've tested both Midi spec for 3.3v (10 and 33 ohm) and Paul's recommendation and both work well in my devices.
I've struggled a lot until discovering my volca beats receive Midi In well only if batteries are charged above 40%.
Hope it helps somebody else.

PS: this picutre has one resistor missing, as @oddson noted and I'll post an updated picture of the protoboard for reference
 
I've tested both Midi spec for 3.3v (10 and 33 ohm) and Paul's recommendation and both work well in my devices.
I've struggled a lot until discovering my volca beats receive Midi In well only if batteries are charged above 40%.
Hope it helps somebody else.

PS: this picutre has one resistor missing, as @oddson noted and I'll post an updated picture of the protoboard for reference

Output done! Used 2 62 ohm resistor 'cause I don't have 0.5w resistor right now..
Tomorrow I'll test the input.
I still don't understand if the 6n137 works with 3.3v. In some datasheet is 4.5-5.5 but in others like this: 6N137.pdf is 3.3v capable..
mine is anonymous.. who knows.. we'll see..

Daniele.
 
I'm using Sharp PC-900V and working flawless.
From what I've seen from the Midi documentation both are acceptable
"opto-isolator (a light emitting diode and a photo sensor which share a single, sealed package). Sharp PC-900V and HP 6N138 opto-isolators have been found acceptable."
 
Well my 6n137 is this: 6N137.pdf and is 5v.

So what to do ?

Sorry for these silly questions but I came back to this hobby after 20 years so I need to relearning almost everything :(

Thanks,
Daniele.
 
If you're using Teensy 3.2 (as you mentioned in message #3), you could also just connect the pullup resistor to +5V. The digital pins on Teensy 3.2 and 3.5 are 5V tolerant, so it's ok to give them a 5V signal.

But do not try that with Teensy LC or 3.6. Those are not 5V tolerant. Applying more than 3.3V to the pin could damage them.
 
If you're using Teensy 3.2 (as you mentioned in message #3), you could also just connect the pullup resistor to +5V. The digital pins on Teensy 3.2 and 3.5 are 5V tolerant, so it's ok to give them a 5V signal.

But do not try that with Teensy LC or 3.6. Those are not 5V tolerant. Applying more than 3.3V to the pin could damage them.

Thanks Paul, works fine with 3.3v.

20170409_122726.jpg

A bit ugly but it's only for a quick test.

Daniele.
 
Two more questions before start soldering..
Can I get 3.3v from the 5v with voltage divider (47k+91k)? One wire less..
Can I attach a led to show midi activity ? I think that should be ok to attach the led to the output pin with a 330ohm resistor.. Same on the midi output ?

Thanks,
Daniele.
 
I think the ones with transistor type output will work as long the LED is working; these should pull the output to a value that will read as LOW by Rx.

The ones with logic gates might require threshold voltages that won't be there if the supply is less than 4.5 v. but something like the 6N138 should work at 3.3 volts.

If you have to power at 5 v. I can't see why a voltage divider ~ 1.52:1 ratio wouldn't work.
 
Last edited:
So I am thinking about using this midi IO board from the MIDIbox.org universe with a T3.2:
http://www.ucapps.de/mbhp/mbhp_midi_io.pdf
I plan to change the Out R's to 47 Ohms and tie them to 3.3V as per the standard but will power the Rx with 5V. This board is designed for an STM32 uC which is 3.3V( 5V tol.) also, but I'm wondering how it might be able to power the Outs with 5V. Is it a matter of the pin handling, just toggling between Float and Sink on the Tx pin? Is the Teensey using push-pull on the UART Tx pin?
Yogi
 
So I am thinking about using this midi IO board from the MIDIbox.org universe with a T3.2:
http://www.ucapps.de/mbhp/mbhp_midi_io.pdf
I plan to change the Out R's to 47 Ohms and tie them to 3.3V as per the standard but will power the Rx with 5V. This board is designed for an STM32 uC which is 3.3V( 5V tol.) also, but I'm wondering how it might be able to power the Outs with 5V. Is it a matter of the pin handling, just toggling between Float and Sink on the Tx pin? Is the Teensey using push-pull on the UART Tx pin?
Yogi

Why 5v ? 3.3v is ok for midi output.

Daniele.
 

Attachments

  • midi-hardware.pdf
    240.2 KB · Views: 506
Why 5v ? 3.3v is ok for midi output.

Daniele.

Hi Daniele, well the board I linked is designed for 5V operation. I'm using a T3.2, which is 5V tolerant, so the opto circuit can be left alone and the T3.2 will be OK with the 5V TTL midi In. But on the TTL midi out I'm adding 3.3V into the board for the current loop and rewiring the two pullup Rs. It's a minor change and there are two un-used conductors on the ribbon cable.

It's just the uC that this board was designed for, the STM32, is also a 3.3V device so I am wondering why it can get way with the Out current loop running at 5V and the Teensey 3.2 should use a 3.3V current loop. They are both 5V tolerant, but I think the STM is setup as open collector UART Tx pins. So I'm interest if the T3.2 can do this also for UART pin.
Yogi
 
I think it will work either way for 5 volt tolerant systems but there does not seem to be anything on that board that needs a 5 volt supply. I think that's Daniele's point.
 
I think it will work either way for 5 volt tolerant systems but there does not seem to be anything on that board that needs a 5 volt supply. I think that's Daniele's point.

Was thinking the 6n138s are 5V devices, could be wrong. If they can operate at 3.3V then wouldn't I have to change all the R values?
Yogi
 
Was thinking the 6n138s are 5V devices, could be wrong. If they can operate at 3.3V then wouldn't I have to change all the R values?
Yogi

Right, 5v. So you need 5v for the input part. Not sure about the output.. Do you already have that board ?
Daniele.
 
Right, 5v. So you need 5v for the input part. Not sure about the output.. Do you already have that board ?
Daniele.
Just finished building it up this afternoon, and yes the two Midi IN channels are @ 5V and the two Midi OUTs are setup for 3.3V (just a minor hack as outlined above). With only 3 UARTs on the T3, there are two un-used conductors on the cable so getting 3.3V to the board was easy enough. It should be good on the T3.2, just trying to figure out how the Tx pins are setup, push-pull or open drain.

I've got a few of these boards already built for MIDIbox projects and like everything interchangeable as much as possible.
Yogi
 
data sheet said:
OUTPUT
Supply and output voltage
6N138
VCC, VO-0.5 to 7V
This is from the data sheet... but logic gate based stuff may need 5v...

Does the data pin have to be 5v tolerant to use a 5v coupler? Short of voltage dividing.

If so the tansistor-based couplers at least should be 3.3v supply friendly for a non-tolerant uC. :confused:
 
Last edited:
Status
Not open for further replies.
Back
Top