Parallel port MIDI interface

This is the right place to discuss on how to implement hardware vsync, adding a VIA or AY chipset, puting multiple roms, or how to design a new flash expansion card.
User avatar
Dbug
Site Admin
Posts: 3841
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Parallel port MIDI interface

Post by Dbug »

I never managed to get the old Serial/MIDI interface on expansion bus to work on the Oric properly, but I discovered recently that there had been some Parallel Port interfaces made for PCs (mostly from MIDIMAN (now M-AUDIO) and MOTU (Mark Of The Unicorn), and I happen to have found one in Oslo today, so decided to get it (cost me more in metro tickets than for the interface itself).

It's a Midiman Portman PC/P (PC Parallel MIDI Interface) with a DB-25 connector on one side, and two classical DIN connectors for the MINI IN and OUT, plus an optional 9vDC (center positive) connector for parallel ports that can't deliver the proper voltage.
image_2021-11-28_185726.png
image_2021-11-28_185741.png
image_2021-11-28_185807.png
I was wondering if this thing could be made to work on the Oric, not necessarily to have both IN and OUT working at the same time, but being able to use either IN or OUT would allow for some cool things, like replay midi files or play YM music using a MIDI keyboard, or even send and receive data.

There are plenty of these interfaces available for cheap on eBay.

The difficulties are:
- I've no idea about the protocol
- I'm not sure which pins it expects to have connected
image_2021-11-28_185833.png
image_2021-11-28_185850.png
The only thing I found where the Windows 98 drivers from the M-Audio website, and a portman_pcp.pdf document containing the following section regarding the parallel port:
Parallel Port Mode
The Parallel Port Mode that your port is set to will also affect the speed
in which your computer communicates with the PORTMAN, and may
need to be considered if there are problems with your computer’s per-
formance. As mentioned in the “About Your Printer Port” section, the
Parallel Port Mode is part of your System Setup, or BIOS. These are
more advanced user settings, so check your computer manual for
guidance.

Generally, the slower speeds won’t affect your printing adversely. The
PORTMAN usually works best in Standard or Uni-Directional (also
called Output only) mode, but use Bi-Directional if your printer
requires it. EPP can be a valid choice, as the PORTMAN occasionally
works better in this mode. ECP is the fastest port mode, and will in
some instances not be compatible with the PORTMAN. However, use
of this mode may be considered when a copy protection “dongle” is
also attached to the Parallel Port.

A little experimentation may be necessary in the matter of your
Parallel Port mode selection, though the issue may not arise at all. For
further tips, consult the Symptoms/Solutions guide if you are experi-
encing any difficulties.

User avatar
kenneth
Flight Lieutenant
Posts: 417
Joined: Fri Nov 26, 2010 9:11 pm
Location: France PdD
Contact:

Re: Parallel port MIDI interface

Post by kenneth »

It could be interesting to see the PCB, a lot of control inputs are maybe not used, in the notice, the data printer port is set as output only, maybe the transfert is in parallel (data bus) or serial mode (STROBE?) as output and serial mode with ACK as input.

User avatar
iss
Wing Commander
Posts: 1349
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Parallel port MIDI interface

Post by iss »

@Dbug posted on Twitter some pics with the box internals.

The EPIC chip is actually simple UART 15C550 serial chip. Probably both '373 latches are used to simulate a processor bus (i.e. first is latched the register address and after this data bits are latched or directly passed through '244). To be sure, PCB need to be traced and schematic reverse-engineered. It sounds scary but it's not!

There should be NO risk to connect Oric's parallel port with straight cable - D0..D7, STB, ACK and (of course) GND. Not known is the sequence how to send data to the device. :?

I would start hacking with setup of an old computer with the native drives and using a program to monitor the data being transferred. The 'software' protocol should be not complex.

Another option is to connect a kind of serial receiver to the MIDI-out, set it with proper SPEED/BITS/PARITY for the MIDI interface and watch how bytes are received when they are LLPRINTed from the Oric :).

User avatar
Dbug
Site Admin
Posts: 3841
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Parallel port MIDI interface

Post by Dbug »

I do have plenty of midi stuff here, including a midi interface on the PC, and code to listen to all the midi traffic, so that's not really a problem.
I guess the first step is to make a cable, I doubt I have a DB-25 male connector lying around, so I'll have to order one.

Here are some other photos, including the bottom side:
image_2021-11-29_095329.png
image_2021-11-29_095339.png

User avatar
ibisum
Wing Commander
Posts: 1491
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: Parallel port MIDI interface

Post by ibisum »

Nice idea! The linux driver for the Portman interface can probably be referenced for details on the protocol, no need to dig further:

https://github.com/torvalds/linux/blob/ ... rtman2x4.c

User avatar
Dbug
Site Admin
Posts: 3841
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Parallel port MIDI interface

Post by Dbug »

ibisum wrote:
Mon Nov 29, 2021 11:51 am
Nice idea! The linux driver for the Portman interface can probably be referenced for details on the protocol, no need to dig further:

https://github.com/torvalds/linux/blob/ ... rtman2x4.c
I did see that one, probably a good base, that being said I would not be 100% confident that the 2x4 is identical inside and uses the same protocol :)

But yeah, I guess the following functions contain useful information:
- portman_probe
- portman_data_avail
- portman_write_midi
- portman_read_midi

User avatar
ibisum
Wing Commander
Posts: 1491
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: Parallel port MIDI interface

Post by ibisum »

The 2x4 is in fact supported by this very driver, so .. not to worry. Just search for PCP2x4 and you'll see the things you need specific to that interface, but everything else is equivalent for the earlier model. EDIT: just wanted to say that I used these very interfaces on Linux in the very early days and the PCP driver supports both, because the 2x4 is just the PCP with more UARTs.

Seems to be a very easy interface to use, could probably even use some of this C code directly on the Oric ..

User avatar
Dbug
Site Admin
Posts: 3841
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Parallel port MIDI interface

Post by Dbug »

ibisum wrote:
Mon Nov 29, 2021 1:56 pm
The 2x4 is in fact supported by this very driver, so .. not to worry. Just search for PCP2x4 and you'll see the things you need. Seems to be a very easy interface to use, could probably even use some of this C code directly on the Oric ..
Yes, that's my point: The interface I got is not a 2x4, it only has one input and one output, while the 2x4 has 2 inputs and 4 outputs.
image_2021-11-29_140018.png

User avatar
iss
Wing Commander
Posts: 1349
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Parallel port MIDI interface

Post by iss »

Dbug wrote:
Mon Nov 29, 2021 2:00 pm
ibisum wrote:
Mon Nov 29, 2021 1:56 pm
so .. not to worry.
I'm more worried about missing (but used in the source) BUSY signal...

User avatar
Dbug
Site Admin
Posts: 3841
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Parallel port MIDI interface

Post by Dbug »

I'm not very good at anything involving the VIA, and I/O in general, I guess for that to work we probably need some delay loops, make sure IRQ are disabled while playing with the VIA/YM input output registers, and probably have to change the direction from write to read all the time, so we can send commands and read the results?

User avatar
ibisum
Wing Commander
Posts: 1491
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: Parallel port MIDI interface

Post by ibisum »

[x]
Last edited by ibisum on Sun Jan 23, 2022 7:51 pm, edited 1 time in total.

User avatar
Dbug
Site Admin
Posts: 3841
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Parallel port MIDI interface

Post by Dbug »

Well, not sure if my first attempt is correct, at least when it's connected I can type with the keyboard and play sounds, so it looks like there's nothing interfering with the normal operation of the machine.

Just tried LPRINT"A"; to see, and the machine froze (probably waiting for ACK).

Not sure my connections are correct I connected:
- 1 to 1 (Strobe)
- 3,5,7,9,11,13,15,17 (D0-D7) to 2,3,4,5,6,7,8,9
- 2,4,6,8,10,12,14,16,18,20 (GND) to 18,19,20,21,22,23,24,25

and I left 11 (BUSY),12 (PAPER OUT),13 (Select),14 (Line Feed),15 (Error),16 (Reset) and 17 (Select Printer) unconnected.
image_2021-12-01_184528.png

ralle
Private
Posts: 7
Joined: Sat Nov 20, 2021 10:35 am

Re: Parallel port MIDI interface

Post by ralle »

Something like this was built in the GDR era. In German, however.
http://robotron.webhop.net/files/kc/MIDI-rfe11_88.pdf

With the 1.77 MHz of the KC there were timing problems, so you can use another method, state-oriented programming. For the C64, i.e. 6502 CPU, the SIO 6850 was used.

User avatar
Dbug
Site Admin
Posts: 3841
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Parallel port MIDI interface

Post by Dbug »

ralle wrote:
Fri Dec 03, 2021 6:15 pm
Something like this was built in the GDR era. In German, however.
http://robotron.webhop.net/files/kc/MIDI-rfe11_88.pdf

With the 1.77 MHz of the KC there were timing problems, so you can use another method, state-oriented programming. For the C64, i.e. 6502 CPU, the SIO 6850 was used.
Probably similar to this thing I tried to get working:
https://forum.defence-force.org/viewtop ... 711#p16711

ralle
Private
Posts: 7
Joined: Sat Nov 20, 2021 10:35 am

Re: Parallel port MIDI interface

Post by ralle »

Oh dear, something for hardcore hobbyists who won't stop at anything. But it works.

Post Reply