Controlling and Resetting the Port
10-17
Asynchronous Serial Port
10.3.6 Using Interrupts
The asynchronous serial port interrupt (TXRXINT) can be generated by three
types of interrupts:
-
Transmit interrupts. A transmit interrupt is generated when the ADTR
empties during transmission. This indicates that the port is ready to accept
a new transmit character. In addition to generating the interrupt, the port
sets the THRE bit of the IOSR to 1. Transmit interrupts can be disabled by
the TIM bit of the ASPCR.
-
Receive interrupts. Any one of the following events will generate a re-
ceive interrupt:
J
The ADTR holds a new character. This event is also indicated by the
DR bit of the IOSR (DR = 1).
J
Overrun occurs. The last character in the ADTR was not read before
the next character overwrote it. Overrun also sets the OE bit of the
IOSR to 1.
J
A framing error occurs. The character received did not have a valid
(logic 1) stop bit. This event is also indicated by the FE bit of the IOSR
(FE = 1).
J
A break has been detected on the RX pin. This event also sets the BI
bit of the IOSR to 1.
J
The character A or a has been detected in the ADTR by the auto-baud
detect logic. This event also sets the ADC bit of the IOSR to 1. This
interrupt will occur regardless of the values of the DIM, TIM, and RIM
bits of the ASPCR.
With the exception of the A detect interrupt, receive interrupts can be dis-
abled by the RIM bit of the ASPCR.
-
Delta interrupts. This type of interrupt is generated if a change takes
place on one of the I/O lines (IO0, IO1, IO2, or IO3) when the lines are used
for ASP control (when DIM = 1 in the ASPCR). The event is also indicated
by the corresponding detect bit (DIO0, DIO1, DIO2, or DIO3) in the IOSR.
Delta interrupts can be disabled by the DIM bit of the ASPCR.