PORTIBM PC Portable (uses same BIOS as XT) 0330-0331 - MPU-401 MIDI(Musical Instrument Digital Interface) A standardized interface for controlling musical instruments with a computer. UART(Universal Asyncronous Receiver/Transmitter)  A peripheral device which converts a sequence of bytes into a serial bit stream at a programmable rate, and vice versa.  This device is what makes an RS-232 serial port function.  See also USART.
Range:	alternate address at PORTIBM PC Portable (uses same BIOS as XT) 0300h, occasionally at PORTIBM PC Portable (uses same BIOS as XT) 0310h or
	  PORTIBM PC Portable (uses same BIOS as XT) 0320h

0330  RW  data register
0331  R-  status register (see #P0575)
0331  -W  command register (see #P0576)
Note:	MPU-401 genarates an interrupt when MIDI(Musical Instrument Digital Interface) A standardized interface for controlling musical instruments with a computer. code is ready; by reading
	  MIDI(Musical Instrument Digital Interface) A standardized interface for controlling musical instruments with a computer. code from the data register this interrupt is cleared


Bitfields for MPU-401 status register:
Bit(s)	Description	(Table P0575)
 7	input ready
	=1 no data is available for reading
	=0 data is available for reading
 6	output ready
	=1 not ready to receive command/data byte
	=0 ready to receive command/data byte
 5-0	reserved
Note:	pending input seems to block the output
SeeAlso: #P0576


(Table P0576)
Values for MPU-401 commands (data go to/from PORTIBM PC Portable (uses same BIOS as XT) 0330h):
Command	Description		 Results  Parameter
 01h	send MIDI(Musical Instrument Digital Interface) A standardized interface for controlling musical instruments with a computer. stop		   ACK	      -
 02h	send MIDI(Musical Instrument Digital Interface) A standardized interface for controlling musical instruments with a computer. start		   ACK	      -
 03h	send MIDI(Musical Instrument Digital Interface) A standardized interface for controlling musical instruments with a computer. continue	   ACK	      -
 15h	stop all (recording,	   ACK	      -
	  playback and MIDI(Musical Instrument Digital Interface) A standardized interface for controlling musical instruments with a computer.)
 34h	return timing bytes	   ACK	      -
	  in stop mode
 35h	enable mode messages	   ACK	      -
	  to PCIBM PC
 38h	enable system common	   ACK	      -
	  messages to PCIBM PC
 39h	enable real time	   ACK	      -
	  messages to PCIBM PC
 3Ch	use CLS sync		   ACK	      -
 3Dh	use SMPTE sync		   ACK	      -
 3Fh	enter UART(Universal Asyncronous Receiver/Transmitter)  A peripheral device which converts a sequence of bytes into a serial bit stream at a programmable rate, and vice versa.  This device is what makes an RS-232 serial port function.  See also USART. mode		   ACK	      -
 80h	use MIDI(Musical Instrument Digital Interface) A standardized interface for controlling musical instruments with a computer. sync		   ACK	      -
 81h	use FSK sync		   ACK	      -
 82h	use MIDI(Musical Instrument Digital Interface) A standardized interface for controlling musical instruments with a computer. sync		   ACK	      -
 83h	enable metronome	   ACK	      -
 84h	disable metronome	   ACK	      -
 87h	enable pitch and	   ACK	      -
	  controller
 8Ah	disable data in stopped	   ACK	      -
	  mode
 8Bh	enable data in stop mode   ACK	      -
 8Ch	disable measure end	   ACK	      -
	  messages to host
 91h	enable ext MIDI(Musical Instrument Digital Interface) A standardized interface for controlling musical instruments with a computer. control	   ACK	      -
 94h	disable clock to host	   ACK	      -
 95h	enable clock to host	   ACK	      -
 97h	enable system exclusive	   ACK	      -
	  messages to PCIBM PC
 ACh	get MIDI(Musical Instrument Digital Interface) A standardized interface for controlling musical instruments with a computer. version	 ACK,VER      -
 ADh	get revision		 ACK,REV      -
 Cxh	set timebase to x*24	   ACK	      -
	  ppqn (x>1)
 D0h	???			   ACK	      -
 DFh	???			   ACK	      -
 E0h	set tempo		   ACK	     BPS
 E4h	set clocks per click	   ACK	     CPC
 E6h	set beats per measure	   ACK	     BPM
 E7h	send all clocks to host	   ACK	    1 byte
					  (04h is sent)
 FFh	reset			   ACK	      -
Notes:	after receiving a command byte MPU-401 must reply with command
	  acknowledge byte FEh in data register
	command parameters are sent, and response bytes are received through
	  the data register
	no commands (except reset) can be issued in UART(Universal Asyncronous Receiver/Transmitter)  A peripheral device which converts a sequence of bytes into a serial bit stream at a programmable rate, and vice versa.  This device is what makes an RS-232 serial port function.  See also USART. mode, and MPU-401
	  must be reset to leave UART(Universal Asyncronous Receiver/Transmitter)  A peripheral device which converts a sequence of bytes into a serial bit stream at a programmable rate, and vice versa.  This device is what makes an RS-232 serial port function.  See also USART. mode
	Key:
		ACK	command acknowledge byte (FEh)
		VER	MIDI(Musical Instrument Digital Interface) A standardized interface for controlling musical instruments with a computer. version number
			bits 7-4: major version
			bits 0-3: minor version
		REV	revision number
		BPS	beats per second (8..250)
		CPC	clocks per click
		BPM	beats per measure
SeeAlso: #P0576