DocID13284 Rev 2 255/564
UM0404 Asynchronous / synchronous serial interface
The cause of an error interrupt request (framing, parity, overrun error) can be identified by
the error status flags in control register S0CON.
Note: In contrary to the error interrupt request flag S0EIR, the error status flags S0FE/S0PE/S0OE
are not reset automatically upon entry into the error interrupt service routine, but must be
cleared by software.
S0TIC (FF6Ch / B6h) SFR Reset Value: - - 00h
S0RIC (FF6Eh / B7h) SFR Reset Value: - - 00h
S0EIC (FF70h / B8) SFR Reset Value: - - 00h
S0TBIC (F19Ch / CEh) ESFR Reset Value: - - 00h
Note: Refer to Section 5.1.3: Interrupt control registers on page 100 for an explanation of the
control fields.
Using the ASC0 Interrupts
For normal operation (besides the error interrupt) the ASC0 provides three interrupt
requests to control data exchange via this serial channel:
• S0TBIRis activated when data is moved from S0TBUF to the transmit shift register.
• S0TIRis activated before the last bit of an asynchronous frame is transmitted, or after
the last bit of a synchronous frame has been transmitted.
• S0RIRis activated when the received frame is moved to S0RBUF.
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 is sufficient to use the transmitter interrupt (S0TIR), 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.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
--------S0TIRS0TIE ILVL GLVL
RW RW RW RW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
--------S0RIRS0RIE ILVL GLVL
RW RW RW RW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
--------S0EIRS0EIE ILVL GLVL
RW RW RW RW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
--------S0TBIRS0TBIE ILVL GLVL
RW RW RW RW