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.
Thanks and if may ask, what do you think about this: http://karg-music.blogspot.it/2016/01/midification.html. On midi out there is only 220 ohm resistor to 3.3v and the 6n137 is fed by 3.3v but the spec say 4.5-5.5v.
Both wrong ?
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.
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.
Originally Posted by oddson
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'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..
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."
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.
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 ?
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.
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
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
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