ivop Posted August 20, 2018 Share Posted August 20, 2018 (edited) Hi, Some of you might remember this thread: http://atariage.com/forums/topic/269207-midi-interface/ I have thought long and hard about it, but I'm just not up to building and testing 20+ devices. I love designing new hard- and software, but committing myself to such a huge undertaking is something I cannot handle. So, I have uploaded the schematics and gerbers to github. They are here: https://github.com/ivop/midimuse There's also the 'midimon' utility which dumps all events received to the screen. MIDI Muse is MIDI Mate compatible, except for the SIO port triggers. In fact, midimon relies on having an external MIDI clock. Feel free to build one yourself. Or more and sell them. It's out there and free to use for everybody. In fact, I would like to encourage anybody who has the capabilities to build some for others! New in revision C btw is the (optional) ability to mix down the stereo audio coming from the Waveblaster board and route it to SIO Audio IN. Have fun! I'm sorry I can't do it, but at least it won't be a "lost" project. Kind regards, Ivo Edited August 20, 2018 by ivop 12 Quote Link to comment Share on other sites More sharing options...
Level42 Posted August 21, 2018 Share Posted August 21, 2018 Thats very Nice....Thanks !! 1 Quote Link to comment Share on other sites More sharing options...
k-Pack Posted August 27, 2018 Share Posted August 27, 2018 I've been wondering what I would do if my MidiMax were to stop working. It's nice to know that the midi projects would have a future. Thank you for uploading your designs. 2 Quote Link to comment Share on other sites More sharing options...
+mytek Posted August 27, 2018 Share Posted August 27, 2018 Thanks for putting this into the public domain Ivo . I intend to incorporate at least part of this into my new 1088XLD project. I'm really looking at having on-board support for the DreamBlaster S2, and will probably also consider adding a header to allow MIDI Connectors to be a future add-on. However I would like to simplify the required circuitry, and since I'm new to MIDI, I have a few questions for when you find the time. Looking at the diagram below, what is the purpose of Q1 and Q2? Because it seems like the opto-isolator's transistor output would be sufficient all on it's own. Diode D1's purpose? Is it really necessary (LEDs can usually take a higher reverse voltage/current)? For standalone use of the DreamBlaster, it would appear that MIDI_OUT coming from the Atari would be all that's needed. What does the MIDI_IN on the DreamBlaster provide, and why the jumper selection between IN and OUT going to this? And finally, what is the purpose of having 3 different clock divisions provided (DIV64, DIV128, DIV256), and which one would be used for the DreamBlaster? Thank you 3 Quote Link to comment Share on other sites More sharing options...
ivop Posted August 27, 2018 Author Share Posted August 27, 2018 (edited) Q1+Q2 is an amplifier. Most (if not all) MIDI schematics I have seen use amps after receiving the signal. Similarly, output gets buffered. I think (not tested) you could replace the LS00 and Q1+Q2 by a hex buffer (something I have been thinking about for revision D). [see edit] D1 is in every MIDI interface schematic I have ever seen, including with other optocouplers. https://www.google.com/search?q=diode+midi+schematic&source=lnms&tbm=isch Waveblaster input select is there so one can select whether the WB board receives its events from the Atari or from an external source. Adding external power to the board, it can be used as a stand-alone Wave Blaster host. The third position disconnects the WB device entirely. You can drop this jumper if you want. The three different clock dividers are there to accommodate different crystals (2, 4 and 8 MHz), just which one is available the cheapest If you fix the crystal type, the jumper can be dropped. Edit: in that case, R4 and R5 are not necessary either. I'd keep the R6 pull-up. Edited August 27, 2018 by ivop 2 Quote Link to comment Share on other sites More sharing options...
ivop Posted August 27, 2018 Author Share Posted August 27, 2018 (edited) I intend to incorporate at least part of this into my new 1088XLD project. I'm really looking at having on-board support for the DreamBlaster S2, and will probably also consider adding a header to allow MIDI Connectors to be a future add-on. Yeah, I figured already you won't be able to have PCB mounted DIN5 connectors because of space restrictions But chassis mounted is more durable anyway. Really nice to see this being picked up! Edited August 27, 2018 by ivop 2 Quote Link to comment Share on other sites More sharing options...
+mytek Posted August 27, 2018 Share Posted August 27, 2018 Thanks for the quick feedback . Since I'll be replacing the 74LS00 with a 74HC04 or perhaps a 74HC14, That way I'll have an extra pair of inverters that be can be utilized to take the place of the transistors. Yeah, I figured already you won't be able to have PCB mounted DIN5 connectors... I'll probably still use PCB mounted DINs, but they'll be mounted on a secondary board with right angle attachment brackets, so only 5 holes would need to be drilled on the case (3 large holes for the DINs, and 2 small holes for the board mounting screws). 2 Quote Link to comment Share on other sites More sharing options...
+Spaced Cowboy Posted August 28, 2018 Share Posted August 28, 2018 s'funny - I was planning the first card in the expansion box to be a midi card, and I already bought one of these Ah well Cheers Simon Quote Link to comment Share on other sites More sharing options...
+mytek Posted August 28, 2018 Share Posted August 28, 2018 s'funny - I was planning the first card in the expansion box to be a midi card, and I already bought one of these Ah well Cheers Simon This doesn't really impact all that much on what you were planning, since only the 1088XLD will be able to accommodate the internal DreamBlaster board. Quote Link to comment Share on other sites More sharing options...
ivop Posted August 28, 2018 Author Share Posted August 28, 2018 (edited) s'funny - I was planning the first card in the expansion box to be a midi card, and I already bought one of these My design gradually evolved and more features were added along the way. Wave Blaster port, external exact MIDI clock, pin header at the side, audio-in loopback, etc... I forgot to revisit the earlier parts of the design and simplify it. Probably because of the excitement of adding new features Perhaps I should have opened the design earlier and have more eyes look at it. Anyway, if you decide to design a MIDI card for your expansion box, mytek's simplification of the transistor based amp, can easily be incorporated. Edited August 28, 2018 by ivop 1 Quote Link to comment Share on other sites More sharing options...
+Spaced Cowboy Posted August 28, 2018 Share Posted August 28, 2018 Well, there's a ways to go before it actually happens I do appreciate you opening the source though - that'll make the job a lot easier Cheers Simon Quote Link to comment Share on other sites More sharing options...
+mytek Posted August 28, 2018 Share Posted August 28, 2018 Using a different opto-isolator allows for a very simple MIDI-IN interface... http://www.notesandvolts.com/2015/02/midi-and-arduino-build-midi-input.html Adjusting the 4.7K resistor value allows for fine tuning the digital output signal. With a value of 3.3K being reported as being better. Fabulous Fab12 on April 2016 stated... Just received my 6n138 opto-couplers, measured various resistors configuration and to reply Timo question 10k gave me poor results as expected, around 5us rise time, whereas suggested 4.7k gave me about 1.35us ; much sharper edge.Now the interesting thing is that I tried 3.3k and got 950ns rise time. It seems to be better and yet not too sharp (too sharp edges could cause other problems on a pcb layout from what i could read). 2 Quote Link to comment Share on other sites More sharing options...
ivop Posted August 29, 2018 Author Share Posted August 29, 2018 For older or badly designed equipment connecting to MIDI IN, you really need an amp after the opto-coupler. Or when (too) long cables are used. Or (too) many devices share a MIDI hub. Come to think of it, I think that's the reason why there's an analog amplifier stage instead of a TTL or CMOS buffer/inverter. I originally had MIDI thru connected before the analog amp, that is U1 pin 5 right into the LS00 pin 12 & 13. It didn't work. None of my Yamaha and Roland synths saw any of the events coming "thru", no matter who was sending or receiving. That's why I moved the connection to after the Q1+Q2 amp. http://atariage.com/forums/topic/269207-midi-interface/page-2?do=findComment&comment=3853788 It's all coming back to me now 3 Quote Link to comment Share on other sites More sharing options...
Kyle22 Posted August 29, 2018 Share Posted August 29, 2018 For older or badly designed equipment connecting to MIDI IN, you really need an amp after the opto-coupler. Or when (too) long cables are used. Or (too) many devices share a MIDI hub. Come to think of it, I think that's the reason why there's an analog amplifier stage instead of a TTL or CMOS buffer/inverter. I originally had MIDI thru connected before the analog amp, that is U1 pin 5 right into the LS00 pin 12 & 13. It didn't work. None of my Yamaha and Roland synths saw any of the events coming "thru", no matter who was sending or receiving. That's why I moved the connection to after the Q1+Q2 amp. http://atariage.com/forums/topic/269207-midi-interface/page-2?do=findComment&comment=3853788 It's all coming back to me now I can see such a situation being very plausible.. Quote Link to comment Share on other sites More sharing options...
+mytek Posted August 29, 2018 Share Posted August 29, 2018 The 6N138 photo-darlington does have considerably more gain then just a single transistor opto-isolator. However it's slew rate is slow, hence the reason for the 4.7k biasing to GND, which drains the base charge that was keeping the output transistor in an active state after the LED had extinguished, thus promoting higher speed operation. If you do a web search you'll see that this is a very popular isolator to use for the Midi-In circuit. Quote Link to comment Share on other sites More sharing options...
ivop Posted August 29, 2018 Author Share Posted August 29, 2018 I remember having ordered both but I received the CNY17 earlier, so based my design around that. Still have a tube of 6N138 in my collection, which came later. I must say, I also liked the smaller form factor of the CNY17, but I guess that gets negated by the need for two extra transistors. Anyway, by the looks of it and by its datasheet, the 6N138 should indeed be capable of driving a TTL or CMOS input. So I'd say, go for it! 1 Quote Link to comment Share on other sites More sharing options...
+mytek Posted August 29, 2018 Share Posted August 29, 2018 I remember having ordered both but I received the CNY17 earlier, so based my design around that. Still have a tube of 6N138 in my collection, which came later. I must say, I also liked the smaller form factor of the CNY17, but I guess that gets negated by the need for two extra transistors. Anyway, by the looks of it and by its datasheet, the 6N138 should indeed be capable of driving a TTL or CMOS input. So I'd say, go for it! Since I don't have any Midi gear to test with, and since you do have some 6N138's on hand, I was wondering if you could test out the circuit below to see if it works as well as your original set-up. No rush on this, since I have lots of time before making a decision on which way I wish to go. The resistors shown in this circuit appear to be the preferred go to values. For reference, here's what the 6N138's output signal looks like with no resistor from pin 7 to ground. And here it is with a 2.4K resistor (Note, the time scale is different, but the byte is the same). A very clean signal indeed . O-Scope displays provided by Todd Bailey (discussion LINK). -------- And an interesting variation using a Schottky diode clamp, that might make for a good alternative circuit. 1 Quote Link to comment Share on other sites More sharing options...
ivop Posted August 29, 2018 Author Share Posted August 29, 2018 Since I don't have any Midi gear to test with, and since you do have some 6N138's on hand, I was wondering if you could test out the circuit below to see if it works as well as your original set-up. No rush on this, since I have lots of time before making a decision on which way I wish to go. The resistors shown in this circuit appear to be the preferred go to values. 6N138_MIDI-IN_ckt.jpg And an interesting variation using a Schottky diode clamp, that might make for a good alternative circuit. 6N138_MIDI-IN_ScottkyClamp.png Sure. I have to look where I left that tube of 6N138's though I plan to disconnect the RX line from a working prototype and breadboard your schematic and see how midimon reacts. 2 Quote Link to comment Share on other sites More sharing options...
+mytek Posted August 29, 2018 Share Posted August 29, 2018 Sure. I have to look where I left that tube of 6N138's though I plan to disconnect the RX line from a working prototype and breadboard your schematic and see how midimon reacts. Sounds good . BTW, I added some O-Scope readings to my previous post that were taken from a 6N138, both with and without a resistor to ground from pin 7. As can be seen, the opto-isolator's darlington pair doesn't do well without a resistor due to it's inherently slow switching speed without it. Quote Link to comment Share on other sites More sharing options...
ivop Posted August 29, 2018 Author Share Posted August 29, 2018 (edited) Bad news. Pokey keeps losing sync. A single missed bit can lead to undefined behaviour. At one point, it even thinks it receives on CH.4. I tested with a 5m MIDI cable first and, thinking that might be the problem (although it should not be), after that with a 1m cable. Same problems. I don't have any Schottky diodes, so I can't test the other circuit. Edit: this happens quite quickly BTW, within a few seconds. Even if you don't press any keys on the keyboard, it starts missing Active Sense events and resets every now and then. Edited August 29, 2018 by ivop Quote Link to comment Share on other sites More sharing options...
ivop Posted August 29, 2018 Author Share Posted August 29, 2018 (edited) Success, I guess? First I lowered 470R to 220R. Didn't seem to do that much, or at least there were still a lot of errors. Then I removed it completely and it started to work! Ran a synth-demo tune through it without any apparent errors. Banging the keyboard randomly and very quick, did not reveal any errors either. And it stayed on CH. 1 Edited August 29, 2018 by ivop 2 Quote Link to comment Share on other sites More sharing options...
+mytek Posted August 29, 2018 Share Posted August 29, 2018 Success, I guess? First I lowered 470R to 220R. Didn't seem to do that much, or at least there were still a lot of errors. Then I removed it completely and it started to work! Ran a synth-demo tune through it without any apparent errors. Banging the keyboard randomly and very quick, did not reveal any errors either. And it stayed on CH. 1 First of all I just wanted to say thanks for being willing to test this, and also for doing it so quickly . So no pull-up resistor means it's an even simpler implementation, and suggests that SIO's pull-up (4.7K?) is sufficient. Looking good. At any rate, I think I'll keep the Midi-In interface circuit off my main board, and relegate it to the DIN interface board so that we don't have to worry about locking it down just yet. Thanks again . 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.