Functional Description
•
Frame-length method: Set the UARTi.UART_MDR1[7] FRAME_END_MODE bit to 0. The MPU writes
the value of the frame length to the UARTi.UART_TXFLH and UARTi.UART_TXFLL registers. The
device automatically attaches end flags to the frame when the number of bytes transmitted equals the
value of the frame length.
•
Set-EOT bit method: Set the FRAME_END_MODE bit to 1. The MPU writes 1 to the
UARTi.UART_ACREG[0] EOT bit just before it writes the last byte to the TX FIFO. When the MPU
writes the last byte to the TX FIFO, the device internally sets the tag bit for that character in the TX
FIFO. As the TX state-machine reads data from the TX FIFO, it uses this tag-bit information to attach
end flags and correctly terminate the frame.
19.3.8.2.6.5 Store and Controlled Transmission
In store and controlled transmission (SCT) mode, the MPU starts writing data to the TX FIFO. Then, after
writing a part of a frame (for a bigger frame) or an entire frame (a small frame; that is, a supervisory
frame), the MPU writes 1 to the UARTi.UART_ACREG[2] SCTX_EN bit (deferred TX start) to start
transmission.
SCT mode is enabled by setting the UARTi.UART_MDR1[5] SCT bit to 1. This transmission method
differs from normal mode, in which data transmission starts immediately after data is written to the TX
FIFO. SCT mode is useful for sending short frames without TX underrun.
19.3.8.2.6.6 Error Detection
When the UARTi.UART_LSR register is read, the UARTi.UART_LSR[4:2] bit field reflects the error bits
[FL, CRC, ABORT] of the frame at the top of the STATUS FIFO (the next frame status to be read).
The error is triggered by an interrupt (for IrDA mode interrupts, see
). The STATUS FIFO must
be read until empty (a maximum of eight reads is required).
19.3.8.2.6.7 Underrun During Transmission
Underrun during transmission occurs when the TX FIFO is empty before the end of the frame is
transmitted. When underrun occurs, the device closes the frame with end flags but attaches an incorrect
CRC value. The receiving device detects a CRC error and discards the frame; it can then ask for a
retransmission.
Underrun also causes an internal flag to be set, which disables additional transmissions. Before the next
frame can be transmitted, the MPU must:
•
Reset the TX FIFO.
•
Read the UARTi.UART_RESUME register, which clears the internal flag.
This function can be disabled by the UARTi.UART_ACREG[4] DIS_TX_UNDERRUN bit, compensated by
the extension of the stop-bit in transmission if the TX FIFO is empty.
19.3.8.2.6.8 Overrun During Receive
Overrun during receive for the IrDA mode has the same function as that for the UART mode (see
, Overrun During Receive).
19.3.8.2.6.9 Status FIFO
In IrDA modes, a status FIFO records the received frame status. When a complete frame is received, the
length of the frame and the error bits associated with the frame are written to the status FIFO.
Reading the UARTi.UART_SFREGH[3:0] MSB and UARTi.UART_SFREGL[3:0] (LSB) bit fields obtains
the frame length. The frame error status is read in the UARTi.UART_SFLSR register. Reading the
UARTi.UART_SFLSR register increments the status FIFO read pointer. Because the status FIFO is eight
entries deep, it can hold the status of eight frames.
The MPU uses the frame-length information to locate the frame boundary in the received frame data. The
MPU can screen bad frames using the error status information and can later request the sender to resend
only the bad frames.
3487
SPRUH73H – October 2011 – Revised April 2013
Universal Asynchronous Receiver/Transmitter (UART)
Copyright © 2011–2013, Texas Instruments Incorporated