JVC MSX MIDI Interface

Page 3/3
1 | 2 |

By Grauw

Ascended (8931)

Grauw's picture

02-04-2020, 00:48

gflorez wrote:

On the CPC the decoding of the port range is made on the connection box by a 74LS138B(all chips installed on the interface have the labels erased), and sent the decoded signal to the main box. F8FXh on the CPC, 0Xh on the MSX.

Then, another decoding is made on the big box. Port 0 is used to receive signals from the clock connector, optional, only used on old MIDI gear, port 2 Write is the Control register, while port 2 Read is the Status register. Port 3 is the Data I/O.

According to the MC6850 data sheet on page 8, a correct initialisation is to send 3 and 16h to the port 2, Control register.

03 means XXXXXX11b, resets the chip.

16h means 00010110:
-Bits 0 and 1, "10" means 2.000.000/64=31250 BAUDS.
-Bits 2 to 4, "101" means 8 bit word 1 stop bit.
-Bits 5 and 6, "00" means /RTS=low and interrupts disabled. "EMR MidiTrack Performer" CPC program uses "10" here, /RTS=high and interrupts disabled.
-Bit 7, "0" means Receive interrupts disabled, but the "EMR MidiTrack Performer" CPC program uses "1" when recording Midi. The EMR interfaces are provided of an /INT signal from the computer, but to use it correctly the computer system interrupt routine needs to be hooked.

Hey gflorez! I can confirm your info is correct, many thanks for that! :D

A simple MIDI IN test program in Basic:

10 OUT 2,3
20 OUT 2,&B00010110
30 IF INP(2) AND 1 THEN PRINT HEX$(INP(3));" ";
40 GOTO 30

I also adjusted the Philips MIDI driver in Synthesix very simply like so, and it worked too:

diff -r ca7232910c39 src/PhilipsMidi.asm
--- a/src/PhilipsMidi.asm       Tue Feb 25 02:16:59 2020 +0100
+++ b/src/PhilipsMidi.asm       Thu Apr 02 00:36:35 2020 +0200
@@ -4,10 +4,10 @@
 ; Philips MIDI uses the M6850 ACIA UART.
 ; See <a href="http://www.mccm.hetlab.tk/millennium/milc/midi/" title="http://www.mccm.hetlab.tk/millennium/milc/midi/">http://www.mccm.hetlab.tk/millennium/milc/midi/</a> for documentation (Dutch).
 ;
-PhilipsMidi_COMMAND: equ 00H
-PhilipsMidi_TRANSMIT: equ 01H
-PhilipsMidi_STATUS: equ 04H
-PhilipsMidi_RECEIVE: equ 05H
+PhilipsMidi_COMMAND: equ 02H
+PhilipsMidi_TRANSMIT: equ 03H
+PhilipsMidi_STATUS: equ 02H
+PhilipsMidi_RECEIVE: equ 03H
 
 
 PhilipsMidi: MACRO
@@ -68,7 +68,7 @@
        ld a,00000011B  ; reset
        out (PhilipsMidi_COMMAND),a
 
-       ld a,10010101B  ; 1 stop bit, no parity, 8 bits, 16x baud (31250 baud)
+       ld a,10010110B  ; 1 stop bit, no parity, 8 bits, 64x baud (31250 baud)
        out (PhilipsMidi_COMMAND),a
 
        ; reset interrupt flag
@@ -140,7 +140,7 @@
        ret nz
        ld a,00000011B  ; reset
        out (PhilipsMidi_COMMAND),a
-       ld a,00010101B  ; 1 stop bit, no parity, 8 bits, 16x baud (31250 baud)
+       ld a,00010110B  ; 1 stop bit, no parity, 8 bits, 64x baud (31250 baud)
        out (PhilipsMidi_COMMAND),a
        in a,(PhilipsMidi_STATUS)
        bit 1,a         ; check TxRDY

It should be pretty easy to patch Philips MIDI compatible software to work with the JVC MIDI interface.

I can also confirm that it mirrors to ports 08-0BH.

By gflorez

Rookie (21)

gflorez's picture

02-04-2020, 01:13

In this Wiki link there is a good explanation of what is that estrange fourth port. It is not part of the MIDI standard, but on mid 80s the "obsolete" Midi equipment came with it.

On the EMR interfaces only pins 1, 2 and 3 are connected, so that Clock port only can be used to receive Clock signal or Start/Stop signal.

On the unfinished disassembly I have sent, you can see how they check the connector:

093F 01 F0 F8 LD BC, F8F0 ;Midi Clock signal
0942 ED 78 IN A, (C)
0944 E6 02 AND 02 ;Sync received?
0946 47 LD B, A
0947 3A 46 26 LD A, (2646)
094A B0 OR B
094B 28 17 JR Z, 0964
094D FE 02 CP 02 ;Is the stored value a Sync?
094F 20 07 JR NZ, 0958
0951 3E 01 LD A, 01
0953 32 46 26 LD (2646), A
0956 18 0C JR 0964

Or here:

0B5E 01 F0 F8 LD BC, F8F0 ;Midi Clock signal
0B61 ED 78 IN A, (C)
0B63 E6 01 AND 01 ;Start/Stop?
0B65 CA 90 0E JP Z, 0E90
0B68 F3 DI
0B69 3A 01 04 LD A, (0401)
0B6C A7 AND A
0B6D 28 08 JR Z, 0B77
0B6F 3D DEC A
0B70 32 01 04 LD (0401), A
0B73 FB EI
0B74 C3 E9 0B JP 0BE9

So you can deduct, a bit 0 set read on port 0 is a Start/Stop signal received(really I still don't know if a 1 is Stop or not....) But is the programmer, you, who must interpret it.

And a bit 1 set marks a beat, that can be counted.

By Grauw

Ascended (8931)

Grauw's picture

02-04-2020, 01:18

Thanks! I’ve added the information to the MSX Assembly Page.

By Manuel

Ascended (16440)

Manuel's picture

02-04-2020, 08:39

Perhaps we can add emulation of this interface to openMSX now? Smile

By o.geerdink

Hero (551)

o.geerdink's picture

03-04-2020, 08:09

Great work!

By Manuel

Ascended (16440)

Manuel's picture

03-04-2020, 20:51

Is there any software I can test an emulated JVC MSX MIDI with?

By Grauw

Ascended (8931)

Grauw's picture

03-04-2020, 21:13

The BASIC test program above, and I’ve also uploaded my adapted Synthesix here. Both test MIDI IN only. Official software is unfortunately missing in action.

By Manuel

Ascended (16440)

Manuel's picture

03-04-2020, 23:55

Unfortunately I have no MIDI in device to test with. Can you test my implementation? It's on the branch mb_JVC_MSX_MIDI...

By Manuel

Ascended (16440)

Manuel's picture

04-04-2020, 23:19

I pushed the (still untested) JVC MSX MIDI emulation to master. The DIN clock thing is not emulated, by the way. Looking forward to any testing you can do.

Page 3/3
1 | 2 |