
XBUS asynchronous / synchronous serial interface
UM0404
DocID13284 Rev 2
XPxIC registers (x = 0, 1, 2, 3). In particular, the four interrupt lines are available on the
following interrupt vectors:
•
ReceiveXP0INTXP1INTXP2INT
•
TransmitXP0INTXP1INTXP2INT
•
Transmit BufferXP0INTXP1INTXP2INT
•
ErrorXP3INT
Section 5.7: X-peripheral interrupt on page 117
for details.
The cause of an error interrupt request (framing, parity, overrun error) can be identified by
the error status flags in control register XS1CON.
Note:
The error status flags S1FE / S1PE / S1OE are not reset automatically upon entry into the
error interrupt service routine, but must be cleared by software.
Using the XASC interrupts
For normal operation (besides the error interrupt) the XASC provides three interrupt
requests to control data exchange via this serial channel:
•
Transmit Buffer (TBIR) internal interrupt signal is activated when data is moved from
XS1TBUF to the transmit shift register.
•
Transmit (TIR) internal interrupt signal is activated before the last bit of an
asynchronous frame is transmitted, or after the last bit of a synchronous frame has
been transmitted.
•
Receive (RIR) internal interrupt signal is activated when the received frame is moved to
XS1RBUF.
While the task of the receive interrupt handler is quite clear, the transmitter is serviced by
two interrupt handlers. This provides advantages for the servicing software.
For single transfers
it is sufficient to use the transmitter interrupt (TIR), which indicates that
the previously loaded data has been transmitted, except for the last bit of an asynchronous
frame.
For multiple back-to-back transfers
it is necessary to load the following piece of data at
last until the time the last bit of the previous frame has been transmitted. In asynchronous
mode this leaves just one bit-time for the handler to respond to the transmitter interrupt
request, in synchronous mode it is impossible at all.
Using the transmit buffer interrupt (TBIR) to reload transmit data gives the time to transmit a
complete frame for the service routine, as XS1TBUF may be reloaded while the previous
data is still being transmitted.
As shown in the
, TBIR is an early trigger for the reload routine, while TIR
indicates the completed transmission. Software using handshake therefore should rely on
TIR at the end of a data block to make sure that all data has really been transmitted.