[comp.sys.atari.st] Problems with new Midi ACIA Transmit Interrupts....

lansd@utcsri.UUCP (11/11/87)

	I have just recently finished writing new Midi Transmit and Receive
interrupt drivers for the ST. Testing revealed a problem with the Transmit
side. The test routine would fill up the transmit Midi buffer with 128 Midi
notes (3 x 128 bytes), and would program the Midi ACIA to start interrupting
if there were no data in the buffer previously to the new data being added.
        While the buffer was being filled, the ACIA would start interrupting
and buffering the Transmit buffer out to the Midi port. This is what should
happen. What actually happens is that the Midi ACIA Tx interrupts just stop
coming in, even though there is data in the TX buffer. After spending about a
week looking into this problem I realized that this random behaviour was due
(I think) to other interrupts coming in - in particular the 200 hz system
timer and mouse/keyboard interrupts.
        It seems to me that these other interrupts, which are also handled by
the MFP chip, are causing the MFP to drop the Midi ACIA's Tx interrupt request,
so my software never sees it. How do I get around this problem? I solved it, in
a crude way, by enabling the Tx interrupts EVERY time  I write a byte into the 
TX buffer, but this slows the program down from 26ms (only enable them when 1st
byte is written)  to 156ms. The cause of the slow down is my program going into
supervisor mode on each call to enable the ACIA Tx interrupts.
        So either I fix this problem or resort to non-buffered Midi output. I
am open to the wildest suggestions!