Wednesday 15 July 2015

MIDI out / thru circuit questions


I made a MIDI in/out circuit, which works, however, I see I have some changes compared to some other circuits I see.




  1. In the official documentation Midi Org I see two resistors on the MIDI out circuit, both 220 ohm. I'm sure I only use one (but I'm not at home, so I cannot check which one I might miss). But so far I didn't get any problems (but never tested in a 'noisy' environment.





  2. In the same scheme, there are 2 inverters (I think), the triangle, one without an A and one with. I also don't use that. I think it's for keeping a steady 0 or 5 V signal, so I think it's good to add. Now I see in some other circuits (randomly from google search with pics), a 74LS04, or 74LS14 or others. At home I have some 74LS14's (Schmitt Trigger hex inverter), but I also read those are for processing signals (like MIDI I guess), but can be slow. So I am not sure what to use, 7404 or 7414? I see also a lot of schemes with 7414's so I guess these are ok.




  3. For the thru I see the same ... does one triangle without and one with A means, I need 2 inverters after each other? Probably it is. Since I want to use 3 MIDI In/Out/Thru's, would that mean 2 (per out or thru) * 2 (out + thru) * 3 (# 3 in/out/thrus) = 12 hex inverters (meaning 2 ICs?); see also item 6




  4. In this circuit, DSS306 are used. I cannot find them on aliexpress, but also they are not in the official MIDI org circuit. Are they needed ... or better (and why)?





  5. In this circuit, transistors are used (2N2222) ... yet another solution (?) What is the advantage? (btw, I plan using BC337's since I have those and are similar, at least if there is a clear advantage).




  6. Also it mentions about the hex inverter, which I probably do not need for the MIDI Out (since it comes from the Arduino, not sure if the Arduino handles this), but for the MIDI Thru I want to connect it directly from the MIDI In. Is that assumption correct? (better use it for both MIDI Out and Thru?)




Thanks if you can help me with one or more of the above questions.



Answer






  1. The official circuit uses three 220 Ω resistors (two in the transmitter and one in the receiver) to limit the current to about 5 mA.


    Dropping one resistor will increase the current to about 8 mA. This is unlikely to damage the receiver, but it might increase the time the optocoupler needs to switch off, and thus foul up the timing of the UART signal (for really cheap and non-compliant receivers that are already on the edge of not working). Anyway, there's no reason to waste power.




  2. The "A" is just a label used in the remark below:



    Gates "A" are IC or transistor.



    When the MIDI specification was written, typical microcontrollers (e.g., 8051) were not able to sink 5 mA of current, so it was necessary to add some buffer. Nowadays, you would be able to use the output pin of most microcontrollers directly, or just use a single non-inverting 74LVC1G07 gate, but thirty years ago, the most easy way to construct a buffer would be to use two gates of a hex inverter. (Whether a Schmitt-trigger input is needed depends on the input signal of the inverter.)


    What exact chip or buffer circuit you use does not really matter, as long as it is capable of 5 mA. (Many older MIDI devices indeed used transistors.)





  3. A Thru circuit is just a normal output circuit connected to a normal input circuit.




  4. The DSS306 are EMI filters. Some kind of filtering is likely to be necessary nowadays; this is one of the reasons that the MIDI schematic you mentioned is outdated and was replaced with the Electrical Specification Update (2014).


    If you are not going to sell the device, or if you are a cheap bastard, don't bother about EMI. Otherwise, use something that filters out high frequencies (MIDI is slow, so you don't need more bandwidth than a few MHz). In practice, many devices use ferrite beads, but RC filters or even common-mode chokes are also used sometimes.




  5. Transistors can handle larger currents and voltages than a logic gate, but that does not matter for MIDI.



    A transistor is just cheaper …




  6. … but if you're using a hex inverter, you might just as well use all of its gates.




No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...