[comp.sys.ibm.pc] PC-MUSIC feature

mark@csd4.milw.wisc.edu (Mark Bamberg) (08/07/87)

I recently purchased a PC-MUSIC card, IBM's MIDI board, for my AT.
I was quite impressed.  In addition to passing MIDI commands to other
devices, the board contains an 8-voice polyphonic synthesizer with
many parameters.

I installed the device and quickly had serial I/O to the card working
as documented in the technical reference.  The card also has a timer
which the documentation says is 8253 compatable.  My problem is that
I can't get the timer to generate interrupts.

The timer is controled by four registers:

CNTR0  -  Count for timer A: 2 (4 usecs) to 65535 (13107 usecs)
CNTR1  -  Count for timer B
CNTR2  -  Second count for timer B
TCWR   -  Time Control Word Register

					Bits      7    6  | 5    4  | 3    2    1  | 0
                            |         |              |
										A    A  | B    B  | C    C    C  | D

                    AA    -  0 = CNTR0; 1 = CNTR2; 2 = CNTR3
										BB    -  0 read count; 3 write counter
										CCC   -  select timer mode: 6 - mode 2; 7 - mode 3
										D     -  ??????? count in BCD?

           Command 34h is supposed to set counter 0
					 Command 0h is supposed to read counter 0

Using these command I can set and examine counter 0.  I can't make it start
counteing, though.  Is there a command which starts the counter?

The card also contains two other registers related to the timer.

TCR  - Total control register
TSR  - Total status register

TCR:
					Bit     Function
					7       IRQ enable (for the whole card)
					6       Total IRQ mask
					3       Timer B enable
					2       Timer A enable
					1       Timer B clear
					0       Timer A clear

TSR:

					Bit     Function
					7       IRQ active (the card is gerating some interrupt)
					1       Timer B status
					0       Timer A status

What I do is to load counter 0, and then enable timer A interrupts.
I figure it should immediately generate a timer interrupt.  But it
doesn't.  It just waits and the counter value doesn't change.
Is there a command that must be issued to the timer to have it count?