MiST 1.3 MIDI to serial?

https://github.com/mist-devel/mist-board/wiki

Moderators: Mug UK, Zorro 2, spiny, Greenious, Moderator Team

Kujako
Atari freak
Atari freak
Posts: 65
Joined: Sun Feb 18, 2018 7:14 am

MiST 1.3 MIDI to serial?

Postby Kujako » Sun Feb 18, 2018 8:58 pm

So given that the MiST 1.3 loses the serial pins in favor of having the MIDI built in, and given that MIDI is basically serial, has anyone done a MIDI to RS232 adaptor and gotten it to work with the Atari and Amiga cores? The Amiga is the one I'm most interested in given that the Atari claims support for USB ethernet. I have a few schematics and the hardware side of it seems simple enough, just not sure how I would properly setup the Amiga to try and "dial out" via MIDI.

Kujako
Atari freak
Atari freak
Posts: 65
Joined: Sun Feb 18, 2018 7:14 am

Re: MiST 1.3 MIDI to serial?

Postby Kujako » Wed Feb 21, 2018 4:57 pm

Not seeing a lot of feedback on this... so I may have my first big project once my MiST gets here. Basically, I'm thinking of something like this.
Image
a schematic from compuphase to go from MIDI to serial to control a MP3 player. Seems like you could go to a modem emulator instead, so long as you could convince the Amiga/Atari to talk to it over the MIDI ports.

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: MiST 1.3 MIDI to serial?

Postby Foxie » Wed Feb 21, 2018 6:09 pm

I wouldn't necessarily recommend building that circuit as-is, because it has a few shortcomings. The three changes I'd make would be to provide some buffering or clamping for the MIDI output and RS-232 pins (connecting a CMOS pin from the MAX232 to a connector is a bad idea). Pin 5 of the MIDI output always needs to have a 220 ohm resistor in series - I see this error a lot in hobby designs and it's completely wrong. I'd also provide a resistor on the base of the 6N138 to ground (about 4.7k) to turn it off faster. Otherwise, it may not reach 31.25k baud reliably. Alternatively, you could replace the 6N138 with a PC900 or H11L1 or H11L4 optocoupler (use a 280 ohm pull-up resistor - although Atari used a 4.7k pull-up and it seemed to work reliably).

You can drastically simplify the circuit though. Here's a design for an Amiga MIDI interface I did a while ago. NOTE: I haven't tested it yet!

Old version:
Amiga MIDI interface.png


Newer version:

Amiga MIDI interface ver2.png


The newer version is the better version for using as an Amiga MIDI interface device. The old version is better for interfacing to general RS-232 devices - because it can swing its output to -12V.

To use it stand-alone, you will need to provide +12 volts on pin 9, and -5 to -12 volts on pin 10. It should provide an acceptable degree of ESD protection. You can probably cheap out and connect pin 10 to ground instead of -12 volts, but that isn't strictly RS-232 compliant. It will work with most RS-232 devices, but not all. You can also use a regulated 5 volt supply on pin 9 by shorting resistor R3, replacing zener diode D2 with a 1N4148 and lowering R8 to 680 ohms.

The +/- 12 volt supply must not exceed 15 volts off-load.

Baud rate is mainly limited by the optocoupler. It will probably work at 38.4k. You might be able to go faster, depending on the characteristics of the particular optocoupler you use. Faster optocouplers are available like the TLP2361, but you'll need to limit the positive supply to exactly 5 volts if using a TLP2361. Don't just substitute any optocoupler because most of them aren't fast enough and/or have a too high threshold current.

You could remove the optocoupler entirely for faster speeds. In this case, instead of connecting the emitter of the 2N3906 to pin 9 of the modem port you connect it to pin 4 of the MIDI input jack. Pin 5 of the MIDI jack connects to where pin 4 of the optocoupler was. R6 needs to be changed to 3.3k. Pin 2 of the MIDI input jack connects to ground (not MIDI compliant, but should work with the MIST). You can remove D3 and R5, but you'll want a 1N4148 diode from pin 4 of the MIDI jack to ground - cathode to pin 4.

If you want a cheap and straightforward way of generating +/- 12 volts from a 5 volt regulated supply, you might use something like this: https://uk.rs-online.com/web/p/isolated ... s/1669112/

Also to keep some RS-232 devices happy, you might want to loop back the following pins on the RS-232 port:
RTS to CTS
DTR to DSR
Alternatively you can just connect RTS and DTR to a +12 volt supply.
You do not have the required permissions to view the files attached to this post.
Last edited by Foxie on Thu Feb 22, 2018 12:33 am, edited 2 times in total.

Kujako
Atari freak
Atari freak
Posts: 65
Joined: Sun Feb 18, 2018 7:14 am

Re: MiST 1.3 MIDI to serial?

Postby Kujako » Wed Feb 21, 2018 7:17 pm

Foxie wrote:I wouldn't necessarily recommend building that circuit as-is, because it has a few shortcomings. The three changes I'd make would be to provide some buffering or clamping for the MIDI output and RS-232 pins (connecting a CMOS pin from the MAX232 to a connector is a bad idea). Pin 5 of the MIDI output always needs to have a 220 ohm resistor in series - I see this error a lot in hobby designs and it's completely wrong. I'd also provide a resistor on the base of the 6N138 to ground (about 4.7k) to turn it off faster. Otherwise, it may not reach 31.25k baud reliably. Alternatively, you could replace the 6N138 with a PC900 or H11L1 or H11L4 optocoupler (use a 280 ohm pull-up resistor - although Atari used a 4.7k pull-up and it seemed to work reliably).

You can drastically simplify the circuit though. Here's a design for an Amiga MIDI interface I did a while ago. NOTE: I haven't tested it yet!

Amiga MIDI interface.png

To use it stand-alone, you will need to provide +12 volts on pin 9, and -5 to -12 volts on pin 10. It should provide an acceptable degree of ESD protection. You can probably cheap out and connect pin 10 to ground instead of -12 volts, but that isn't strictly RS-232 compliant. It will work with most RS-232 devices, but not all. You can also use a regulated 5 volt supply on pin 9 by shorting resistor R3, replacing zener diode D2 with a 1N4148 and lowering R8 to 680 ohms.

The +/- 12 volt supply must not exceed 15 volts off-load.

Baud rate is mainly limited by the optocoupler. It will probably work at 38.4k. You might be able to go faster, depending on the characteristics of the particular optocoupler you use. Faster optocouplers are available like the TLP2361, but you'll need to limit the positive supply to exactly 5 volts if using a TLP2361. Don't just substitute any optocoupler because most of them aren't fast enough and/or have a too high threshold current.

You could remove the optocoupler entirely for faster speeds. In this case, instead of connecting the emitter of the 2N3906 to pin 9 of the modem port you connect it to pin 4 of the MIDI input jack. Pin 5 of the MIDI jack connects to where pin 4 of the optocoupler was. R6 needs to be changed to 3.3k. Pin 2 of the MIDI input jack connects to ground (not MIDI compliant, but should work with the MIST). You can remove D3 and R5, but you'll want a 1N4148 diode from pin 4 of the MIDI jack to ground - cathode to pin 4.

If you want a cheap and straightforward way of generating +/- 12 volts from a 5 volt regulated supply, you might use something like this: https://uk.rs-online.com/web/p/isolated ... s/1669112/

Also to keep some RS-232 devices happy, you might want to loop back the following pins on the RS-232 port:
RTS to CTS
DTR to DSR
Alternatively you can just connect RTS and DTR to a +12 volt supply.


Thanks for the info, will make use of it when I find myself not being lazy enough to tackle this project. May also look at adding support for USB to serial instead... not sure which path is the one of least resistance. For when I'm lazy as I normally am, I'll just pull the SD card and load the drive image into an emulator to get online and download stuff.

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: MiST 1.3 MIDI to serial?

Postby Foxie » Thu Feb 22, 2018 12:51 am

Kujako wrote:Thanks for the info, will make use of it when I find myself not being lazy enough to tackle this project. May also look at adding support for USB to serial instead... not sure which path is the one of least resistance. For when I'm lazy as I normally am, I'll just pull the SD card and load the drive image into an emulator to get online and download stuff.


I don't know exactly what's involved with implementing USB to serial. USB is extremely over-complicated so I would imagine it would be a major undertaking.

Providing the Amiga core uses the MIDI I/O as a modem port, it will be much simpler just to build a suitable interface. There's few enough components that you could just build it on perfboard or a plug-in breadboard.

I've found a later version of the MIDI interface device schematic, I've updated the post with it. The old version is probably a better choice for driving RS-232 devices other than Amigas. It's a bit more compatible (but does need -12V). You could always try it with ground instead of -12V and see if your device (modem emulator?) is compatible with it.

The external power supply needs to be able to deliver about 60mA on +12V, and 10mA on -12V. Of course you don't need the power supply if it's plugged into a real Amiga because it draws power from the modem port. But using it backwards with a MIST, you'll need external power.

ericgus
Captain Atari
Captain Atari
Posts: 373
Joined: Fri Apr 08, 2016 4:53 am
Location: Boston MA - USA

Re: MiST 1.3 MIDI to serial?

Postby ericgus » Thu Feb 22, 2018 4:00 am

the old mist had its advantage in that without any additional circuitry needed, you could wire the RX/TX lines that formerly connected to the Mist's midi board directly to the GPIO serial console lines of a Raspberry Pi... Why? because the Raspberry Pi's gpio uses the same voltage levels as the Mists tx/rx lines and does not require any voltage level shifting if say you wanted to use a standard rs232 connection which does.. The direction they took by hardwiring the midi in the last rev of the mist IMHO was a mistake because it was more useful to allow the end user to disconnect the midi and use the RX/TX lines as they saw fit (or the core author specifically)

http://blog.paradroyd.com/post/13461072 ... -mist-fpga
This really isn’t a mod as all I’m doing is adding a connector to the board and plugging some wires into it. What this will give me is a 3.3 volt serial connector that I can tie straight into the serial lines on the GPIO of a Raspberry Pi. This connection is supported “out of the box” in the Amiga/Minimig core, and possibly other cores as well.


It was really just a matter of taking the case apart, taking the board out, and soldering a connector to the board.

Image

Image

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: MiST 1.3 MIDI to serial?

Postby Foxie » Thu Feb 22, 2018 5:05 am

One potential pitfall to watch out for if wiring a Raspberry Pi and MIST together like that is latchup. Without looking at the datasheets for the Pi's MCU and the FPGA used on the MIST, I can't tell if it's vulnerable to latchup.

The problem occurs if one of the two devices is powered off and the other is powered on. With many CMOS ICs, there are clamping diodes from the inputs to the supply. If you drive the input to +3.3V with it powered off, current flows through the diode. This can cause two bad things to happen. First, you can exceed the current the diode is rated for and cause gradual or immediate damage to the IC. Second, if the powered-off device is then powered up the device can enter latchup. This will probably cause immediate destruction of the IC. It occurs because the parasitic SCR that's formed by the diode structures gets triggered. It then shorts out the supply, sinking amps of current. Whether the SCR actually triggers is really a matter of luck.

Some ICs are invulnerable to latchup because they lack the diodes to the supply rail. In this case, no problem with a direct connection.

One way to prevent latchup is to limit the current by putting resistors in series with the inputs on each device. The exact resistor value depends on the maximum clamping current allowed by the ICs. I've seen values from 0.5mA to 30mA before.

Too high a value resistor can be a problem if the receiving device has a pull-up resistor - it will never be able to pull it low enough. In this situation, the simplest way to make the interface is using schottky diodes and pullup resistors. The input should be pulled to the receiver's 3.3V supply, and a schottky diode is connected anode to the input. The transmitter's output is connected to the other side of the diode. The pullup resistor needs to be a fairly high value to avoid forcing too much current through the transmitter's clamping diode.

Looking at the datasheet for the FPGA and Pi MCU (if available?) would determine whether such measures are actually needed. I've looked at the datasheets for a few FPGAs, and they seem not to have the clamping diode.

ericgus
Captain Atari
Captain Atari
Posts: 373
Joined: Fri Apr 08, 2016 4:53 am
Location: Boston MA - USA

Re: MiST 1.3 MIDI to serial?

Postby ericgus » Fri Feb 23, 2018 6:04 pm

He's had no problems with latchup.

Kujako
Atari freak
Atari freak
Posts: 65
Joined: Sun Feb 18, 2018 7:14 am

Re: MiST 1.3 MIDI to serial?

Postby Kujako » Fri Feb 23, 2018 6:10 pm

Interesting related topic, found info on using STing to connect an ST to a Falcon over MIDI which is connected to a PC over serial to get both the ST and Falcon online... so there is support for IP routing over MIDI on the ST.

http://paradize.final-memory.org/sting1.shtml

Unfortunately, the site for STinG is gone... not sure where to find the software now.

Edit : found it (http://jfhaslam.atari.org/download.htm#Internet)

Can also just run MIDI directly to a Raspberry Pi GPIO (http://samplerbox.org/article/midiinwithrpi) so that may be the simplest solution.

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: MiST 1.3 MIDI to serial?

Postby Foxie » Sat Feb 24, 2018 7:11 pm

Kujako wrote:Can also just run MIDI directly to a Raspberry Pi GPIO (http://samplerbox.org/article/midiinwithrpi) so that may be the simplest solution.


Hmm, is it really acceptable to run the 6N138 on a 3.3V supply? The datasheet only characterizes it down to 4.5V, so I would tend to assume it requires a 5V supply. Obviously it works for that guy, but it may not be completely reliable.

A better choice might be the H11L1. That will definitely work with a 3.3V supply, and you don't need the extra base resistor either. The MIDI spec recommends a 270 ohm pullup resistor with the H11L1/PC900, but Atari used a 4.7k resistor and it seemed to work reliably. At 3.3V you'd want to lower those values accordingly - 180 ohms to 3.3k. I don't know how much current the Raspberry Pi's power supply can deliver.

Also with either the 6N138 or H11L1 you always need a 0.1uF decoupling capacitor across the optocoupler's supply. That isn't shown in the schematic on that site, but it's quite important.

I find it slightly strange that Atari went to the trouble to implement a LAN port, yet never really seemed interested in encouraging developers to use the MIDI ports for networking. Providing all machines in the network are switched on, a MIDI loop seems like the perfect way to do networking on the cheap - much cheaper than AppleTalk. You could also design an inexpensive switch box which sucks power from the MIDI port and loops the input to the output when the machine is turned off - a bit like token ring.

kolla
Captain Atari
Captain Atari
Posts: 163
Joined: Thu Sep 17, 2015 11:39 pm
Contact:

Re: MiST 1.3 MIDI to serial?

Postby kolla » Fri Mar 02, 2018 10:36 am

I have Rasperry pi zero built into the MiST, stuck ontop of the SD card reader, and it takes 5V from the MiST power input, so the devices are turned up and down as one. And I never ever had a more stable and reliable null-model setup between two systems :)

Pictures here: http://www.minimig.net/viewtopic.php?f=14&t=666
-- kolla

Kujako
Atari freak
Atari freak
Posts: 65
Joined: Sun Feb 18, 2018 7:14 am

Re: MiST 1.3 MIDI to serial?

Postby Kujako » Fri Mar 02, 2018 3:31 pm

kolla wrote:I have Rasperry pi zero built into the MiST, stuck ontop of the SD card reader, and it takes 5V from the MiST power input, so the devices are turned up and down as one. And I never ever had a more stable and reliable null-model setup between two systems :)

Pictures here: http://www.minimig.net/viewtopic.php?f=14&t=666


Good setup, but lamentably no longer possible with the MiST 1.3+, thus the discussion of if we can use the MIDI ports despite the weirdness and speed limitations.

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: MiST 1.3 MIDI to serial?

Postby Foxie » Fri Mar 02, 2018 8:06 pm

Kujako wrote:Good setup, but lamentably no longer possible with the MiST 1.3+, thus the discussion of if we can use the MIDI ports despite the weirdness and speed limitations.


If you're connecting to a Raspberry Pi, you can do this much more simply. You don't need any of the complex level shifting circuitry you need with a general RS-232 output.

Here's a schematic. Untested, but I see no reason why it won't work:

Screen Shot 2018-03-02 at 20.03.41.png


Speed is limited by the optocoupler in the MIST. 38.4k should work, higher speeds may or may not. Of course, you could modify the MIST and bypass the optocoupler for maximum speed.
You do not have the required permissions to view the files attached to this post.

Kujako
Atari freak
Atari freak
Posts: 65
Joined: Sun Feb 18, 2018 7:14 am

Re: MiST 1.3 MIDI to serial?

Postby Kujako » Sat Mar 03, 2018 6:24 pm

Foxie wrote:
Kujako wrote:Good setup, but lamentably no longer possible with the MiST 1.3+, thus the discussion of if we can use the MIDI ports despite the weirdness and speed limitations.


If you're connecting to a Raspberry Pi, you can do this much more simply. You don't need any of the complex level shifting circuitry you need with a general RS-232 output.

Here's a schematic. Untested, but I see no reason why it won't work:

Screen Shot 2018-03-02 at 20.03.41.png

Speed is limited by the optocoupler in the MIST. 38.4k should work, higher speeds may or may not. Of course, you could modify the MIST and bypass the optocoupler for maximum speed.


Yeah, more or less what I'll be trying. Got my MiST and am futzing around with it a bit before I try anything too seriously.

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: MiST 1.3 MIDI to serial?

Postby Foxie » Mon Mar 05, 2018 7:42 pm

Kujako wrote:Yeah, more or less what I'll be trying. Got my MiST and am futzing around with it a bit before I try anything too seriously.


If you do build something like the circuit shown, then be sure to include the diode because it protects the Pi from latchup damage (the 10k resistor being as high as it is also protects the MIST from latchup).

The circuit shown omits the series resistor between the Pi's output and the MIST input. The MIST's optocoupler can easily handle the higher current, and it should deliver faster speeds. Going by the typical values published in the data book for the 6N138, a rise/fall time of about 2us could be achieved. Unfortunately, the MIST runs the optocoupler out of spec (at 3.3V supply) so who knows what will really happen. It's amazing it works at all. If you can achieve 2us, then 115.2k may be possible.

User avatar
Alynna
Atarian
Atarian
Posts: 9
Joined: Tue Sep 18, 2018 5:54 pm

Re: MiST 1.3 MIDI to serial?

Postby Alynna » Tue Sep 18, 2018 6:03 pm

Is it possible to desolder the midi on my MiST 1.3+ and attach my Raspberry pi directly to it? I made a mistake and bought the one with the MIDI thinking thats the only one that was available, but I really want to use generic serial on it.

Basically what I am asking is, Do those pins on the MiST function identically to previous versions and I could hook up a pi directly if I removed the MIDI interface?

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1162
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: MiST 1.3 MIDI to serial?

Postby MasterOfGizmo » Tue Sep 18, 2018 8:43 pm

Alynna wrote:Is it possible to desolder the midi on my MiST 1.3+ and attach my Raspberry pi directly to it? I made a mistake and bought the one with the MIDI thinking thats the only one that was available, but I really want to use generic serial on it.

Basically what I am asking is, Do those pins on the MiST function identically to previous versions and I could hook up a pi directly if I removed the MIDI interface?


I don't have one of those boards. But if you post a photo of the bottom PCB side then i can show you the trace you might cut to detach the MIDI input (RX) signal from the FPGA. The output can be left untouched as it won't hurt if the FPGAs TX signal shows up at MIDI as well.
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki

User avatar
Alynna
Atarian
Atarian
Posts: 9
Joined: Tue Sep 18, 2018 5:54 pm

Re: MiST 1.3 MIDI to serial?

Postby Alynna » Tue Sep 18, 2018 11:28 pm

As soon as I get home i'll open it up, thank you.

User avatar
Alynna
Atarian
Atarian
Posts: 9
Joined: Tue Sep 18, 2018 5:54 pm

Re: MiST 1.3 MIDI to serial?

Postby Alynna » Wed Sep 19, 2018 4:10 pm

https://public.kitsunet.net/i/mist/20180918_234235.jpg
https://public.kitsunet.net/i/mist/20180918_234543.jpg

Those are the images. I was kind of hoping there would be a vestige of a header left that I could desolder but it looks like its going to be a real hassle.
I am also very curious as to what the jumpers do and in particular what the 4 pin header does near SV3. Is there any documentation anywhere?

User avatar
Alynna
Atarian
Atarian
Posts: 9
Joined: Tue Sep 18, 2018 5:54 pm

Re: MiST 1.3 MIDI to serial?

Postby Alynna » Wed Sep 19, 2018 4:28 pm

I kind of feel from a cursory look at my own pictures that the 8 pin chip near the left bottom screw has something to do with it it seems all the traces lead there. If I can tap RX/TX from there and desolder other pins from it it'd be super convenient.

We then could publish the modification so others can fix their 2k17 series MiSTs.

User avatar
Alynna
Atarian
Atarian
Posts: 9
Joined: Tue Sep 18, 2018 5:54 pm

Re: MiST 1.3 MIDI to serial?

Postby Alynna » Thu Sep 20, 2018 5:24 pm

If I power a pi 0 W from the MiST, can I omit the latchup protection? It seems that would only be required if I were powering externally. At this point I am considering putting a pi 0 W inside the mist and soldering onto the midi ports and the 5v source at the power switch.

User avatar
Alynna
Atarian
Atarian
Posts: 9
Joined: Tue Sep 18, 2018 5:54 pm

Re: MiST 1.3 MIDI to serial?

Postby Alynna » Sat Sep 22, 2018 10:27 pm

I have had success interfacing serial through the MIDI port, fastest reliable speed is 38400. I will post a guide shortly. It is based on Foxie's circuit, and it is for putting a pi 0 W inside a Mist 1.3+

User avatar
Alynna
Atarian
Atarian
Posts: 9
Joined: Tue Sep 18, 2018 5:54 pm

Re: MiST 1.3 MIDI to serial?

Postby Alynna » Sat Sep 22, 2018 10:38 pm

Here is some proof of the concept:
Image
Image
Image

User avatar
Alynna
Atarian
Atarian
Posts: 9
Joined: Tue Sep 18, 2018 5:54 pm

Re: MiST 1.3 MIDI to serial?

Postby Alynna » Sat Sep 22, 2018 11:06 pm

These are just in case I don't get to a guide right away, I will be doing alot of software related stuff the next few days with this:
Image
Image

User avatar
MasterOfGizmo
Atari God
Atari God
Posts: 1162
Joined: Fri Feb 08, 2013 12:15 pm
Contact:

Re: MiST 1.3 MIDI to serial?

Postby MasterOfGizmo » Sun Sep 23, 2018 8:58 am

Alynna wrote:Those are the images.


This is the trace that brings the RX signal from the MIDI port to the FPGA. You can cut it and feed your own signal into the FPGA:
mist_midi_tx.jpg


The signal comes from pin 13 of IC8 and from pin 6 of OC1 (the big 8 pin DIL optocoupler). If you don't want to cut traces you could also lift those pins.

The 4 pin header SV3 is described here: https://github.com/mist-devel/mist-boar ... Usb2Serial

And the jumper JP1 is described here: https://github.com/mist-devel/mist-boar ... er-windows

BTW: Nice, blue boards. I've only seen white ones.
You do not have the required permissions to view the files attached to this post.
MIST board, FPGA based Atari STE and more: https://github.com/mist-devel/mist-board/wiki


Return to “MiST”

Who is online

Users browsing this forum: No registered users and 5 guests