Re: MIDI conjunction device
- From: Paul Keinanen <keinanen@xxxxxx>
- Date: Sun, 19 Mar 2006 13:13:34 +0200
On Sat, 18 Mar 2006 09:28:23 -0800, "Michael R. Kesti"
<mrkesti@xxxxxxxxxx> wrote:
The solution is to queue received messages, replacing any implied
status characters with their actual values and (optionally) regenerate
running status after the input queues are read and as the messages are
transmitted.
I don't see a problem implementing this with a single byte delay in
interrupt context, just reserve one byte for the input status on each
channel and one for the output channel to generate the status on the
input and strip redundant status bytes on the output.
The input RxFull interrupt just moves the bytes to input queue (which
can hold 0-3 bytes) and when it appears to be overflowing, move a full
3 byte message to the global output queue. If the TxUART is inactive
when the first byte arrives at an input channel, that channel can
simply enable the OUT UART interrupt and the TxEmpty interrupt will be
immediately pending and executed when the Rx interrupt returns. The
TxEmpty interrupt selects the next byte to transmit either from the
input queue that at that time contains stat (or stat+datA) bytes from
the only active channel or from the global OUT queue.
The only nasty thing about using only the TxEmpty interrupts to feed
the output UART is the baud rate error problem. If the input baud rate
is below nominal and the OUT UART baud rate is above nominal, the
TxEmpty interrupt may be executed before the RxFull interrupt for the
next byte, in which case the input FIFO is empty and the input channel
needs to re-enable the Tx interrupt when the next input byte finally
arrives. In this sense, a delay greater than one byte time would make
sense.
Paul
.
- References:
- Re: MIDI conjunction device
- From: ahmed.sharifi@xxxxxxxxx
- Re: MIDI conjunction device
- From: Michael R. Kesti
- Re: MIDI conjunction device
- From: ahmed.sharifi@xxxxxxxxx
- Re: MIDI conjunction device
- From: Michael R. Kesti
- Re: MIDI conjunction device
- From: Paul Keinanen
- Re: MIDI conjunction device
- From: Michael R. Kesti
- Re: MIDI conjunction device
- From: Paul Keinanen
- Re: MIDI conjunction device
- From: Michael R. Kesti
- Re: MIDI conjunction device
- From: Michael R. Kesti
- Re: MIDI conjunction device
- Prev by Date: Re: OCX control for impact printer
- Next by Date: Re: C166 Simulator, open source, any ?
- Previous by thread: Re: MIDI conjunction device
- Next by thread: directly to access globle var or to call a globle function to access the var?
- Index(es):
Relevant Pages
|
|