1. OCAU Merchandise is available! Check out our 20th Anniversary Mugs, Classic Logo Shirts and much more! Discussion in this thread.
    Dismiss Notice

Simple CD32 MIDI out

Discussion in 'Retro & Arcade' started by Grant, Mar 26, 2021.

  1. Grant

    Grant Member

    Joined:
    Jan 23, 2002
    Messages:
    2,348
    Location:
    Wollongong
    I've been loving all of the MIDI hype that's been going around recently with MT32-Pi etc., and I've been playing around with it on my Amigas.

    TL;DR, you can get MIDI out from a CD32 with 3 components, 2 connectors, and some wiring.

    A while ago I made up an Amiga serial-MIDI adapter using the instructions from LSD Docs Disk #5, posted here. The diagram has been lost to the Internet so I'll reattach it to this post:

    81.png

    Sparkfun has a good description of MIDI at an electrical level, and looking at this schematic (specifically the MIDI OUT path) compared to a description of Amiga serial ports, it's not the best choice of components.

    As per the Sparkfun guide, the 74LS04 here would normally be used as a current buffer: old electronics can't provide much current through their signal pins, and if the receiving device draws too much current, it can burn out the transmitter chip. So you power the 74LS04 with the main 5v rail that can supply lots of current, and use it to forward the signals.

    But RS-232 serial ports typically use +/- 12v, so we're also slightly abusing the 74LS04 to provide voltage translation. On the MIDI IN side, we're depending on the Amiga interpreting 0v and 5v in the same way as -12v and +12v (I think this is okay according to RS-232), and on the MIDI OUT side we're relying on the built-in diodes in the 74LS04 to block the -12v, and putting in +12v where it expects +5v. The 'LS04 datasheet says the "absolute maximum" input voltage is 7v, and going over that "for extended periods may affect device reliability", but it works, so ¯\_(ツ)_/¯

    The MAX232 series chips is the default choice for these things, and is used in commercial Amiga MIDI adapters that I've seen. It does proper bidirectional voltage translation between TTL 0-5v levels and RS-232 +/-12v levels.

    This brings me to my CD32, which is basically an Amiga 1200 with a CD-ROM drive, especially when you fit it out with expansion board that gives it IDE, and some way of hooking up an external keyboard. My expansion setup has a proper PS/2 keyboard port on it, but the CD32 also has this AUX port next to the joypad/mouse ports. It's the same Mini-DIN6 female connector as a PC PS/2 port, but only Amiga style keyboards work on it.

    The AUX port also has "serial" transmit and receive lines on the 2 unused pins, and there are various commercial and homebrew circuits for hooking up the CD32 with serial networking to other computers and devices. So you could buy a CD32->serial adapter, and a serial->MIDI adapter, and use the CD32 to MIDI to an MT32.

    But what is a "CD32->serial" adapter? Turns out the "serial" lines are TTL-level 0-5v signal lines. So a "CD32->serial" adapter is basically a MAX232 chip converting these TTL levels to RS-232 levels, and by attaching a MIDI out on that, you're using a MAX232 chip to convert RS-232 levels to TTL levels. You can see where I'm going with this...

    Theoretically you could just stick the current-limiting 220-ohm resistors onto the "transmit" and "5v" lines from the CD32, and connect those directly to a DIN5 MIDI socket. That's dangerous and could burn out the I/O chip on the CD32 though, so we're back to our old friend the 74LS04 to provide current buffering. As per the Sparkfun article, if you take the transmitted signal and send it through 2 inverter gates, you get a nice buffered copy of it to send down a MIDI cable.

    So the 3 components from the TL;DR are a 74LS04 and 2x 220-ohm resistors.

    For the circuit, rather than try to do an ASCII art representation I'll point to the ones above and just describe the 3 lines you need to connect from CD32 to MIDI OUT:

    Code:
    Mini DIN6 plug pin 2 (/TxD) -> 74LS04 pin 1
    74LS04 pin 2 -> 74LS04 pin 3
    74LS04 pin 4 -> 220 ohm resistor #1
    220 ohm resistor #1 -> MIDI DIN5 socket pin 5
    
    Mini DIN6 plug pin 4 (+5v) -> 74LS04 pin 14
    Mini DIN6 plug pin 4 (+5v) -> 220 ohm resistor #2
    220 ohm resistor #2 -> MIDI DIN5 socket pin 4
    
    Mini DIN6 plug pin 3 (GND):
    -> 74LS04 pins 5, 7, 9, 11, 13
    -> MIDI DIN5 socket pin 2

    For the Mini DIN6 plug, you can't just hack off an old PS/2 keyboard or mouse plug, because PS/2 ports usually don't have pin 2 or 6 wired up. But the whole point of this circuit is that you can just go to a local Jaycar and buy all of the parts on a weekend, rather than waiting weeks for a commercial adapter from overseas.

    Here's some photos of the little proto board I made to hold these:

    cd32-midi-out-top.jpg cd32-midi-out-back.jpg

    And it works!

    cd32-midi-demo.jpg

    QfG2 is painfully slow on Amiga (even on a 68030 in my A1200), but it's a mild pain that is easily overcome by my joy from playing the Amiga version with an MT32 :leet:

    Next up is to put it into a project box, and build a MT32-Pi dedicated to the CD32 (in the tradition of attaching fast computers to slow computers).
     
    Last edited: Mar 26, 2021
    genxor, MUTMAN, hutts24 and 2 others like this.
  2. power

    power Member

    Joined:
    Apr 20, 2002
    Messages:
    70,149
    Location:
    brisbane
    could you maintain the aux port for keyboard and do this at the same time? (I use an adapter and CDTV keyboard over the PS/2).
     
  3. OP
    OP
    Grant

    Grant Member

    Joined:
    Jan 23, 2002
    Messages:
    2,348
    Location:
    Wollongong
    Yep, in my case the 2 lines used for keyboard (AUX pins 1 and 5) are simply not connected. Most commercial CD32 sernet adapters I've seen have keyboard passthrough too, you just also have to pass through the 5v and GND lines.
     
  4. power

    power Member

    Joined:
    Apr 20, 2002
    Messages:
    70,149
    Location:
    brisbane
    very interesting, i'd eventually like all my Amigas to be MIDI capable, it never occurred to me that the CD32 would be on the list - this is very cool.
     
    Last edited: Mar 26, 2021

Share This Page

Advertisement: