![](http://datasheet.mmic.net.cn/Energy-Micro/EFM32TG840F16_datasheet_97240/EFM32TG840F16_181.png)
Preliminary
...the world's most energy friendly microcontrollers
2011-05-19 - d0034_Rev0.91
181
www.energymicro.com
frames, complete with control bits to be written at once. When data is written to the transmit buffer
using USARTn_TXDATAX and USARTn_TXDOUBLEX, the 9th bit(s) written to these registers override
the value in BIT8DV in USARTn_CTRL, and alone define the 9th bits that are transmitted if 9-bit
USARTn_FRAME is configured to less than 10 bits.
Figure 15.3. USART Transmit Buffer Operation
Writ e CTRL
TX buffer elem ent 1
TX buffer elem ent 0
Shift regist er
Peripheral Bus
Writ e CTRL
TXDOUBLE,
TXDOUBLEX
TXDATA,
TXDATAX
When writing more frames to the transmit buffer than there is free space for, the TXOF interrupt flag in
USARTn_IF will be set, indicating the overflow. The data already in the transmit buffer is preserved in
this case, and no data is written.
In addition to the interrupt flag TXC in USARTn_IF and status flag TXC in USARTn_STATUS which are
set when the transmitter is idle, TXBL in USARTn_STATUS and the TXBL interrupt flag in USARTn_IF
are used to indicate the level of the transmit buffer. TXBIL in USARTn_CTRL controls the level at which
these bits are set. If TXBIL is cleared, they are set whenever the transmit buffer becomes empty, and if
TXBIL is set, they are set whenever the transmit buffer goes from full to half-full or empty. Both the TXBL
status flag and the TXBL interrupt flag are cleared automatically when their condition becomes false
The transmit buffer, including the transmit shift register can be cleared by setting CLEARTX in
USARTn_CMD. This will prevent the USART from transmitting the data in the buffer and shift register,
and will make them available for new data. Any frame currently being transmitted will not be aborted.
Transmission of this frame will be completed.
15.3.2.3.2 Frame Transmission Control
The
transmission
control
bits,
which
can
be
written
using
USARTn_TXDATAX
and
USARTn_TXDOUBLEX, affect the transmission of the written frame. The following options are available:
Generate break: By setting TXBREAK, the output will be held low during the stop-bit period to generate
a framing error. A receiver that supports break detection detects this state, allowing it to be used e.g.
for framing of larger data packets. The line is driven high before the next frame is transmitted so the
next start condition can be identified correctly by the recipient. Continuous breaks lasting longer than
a USART frame are thus not supported by the USART. GPIO can be used for this.
Disable transmitter after transmission: If TXDISAT is set, the transmitter is disabled after the frame
has been fully transmitted.
Enable receiver after transmission: If RXENAT is set, the receiver is enabled after the frame has
been fully transmitted. It is enabled in time to detect a start-bit directly after the last stop-bit has been
transmitted.
Unblock receiver after transmission: If UBRXAT is set, the receiver is unblocked and RXBLOCK is
cleared after the frame has been fully transmitted.
Tristate transmitter after transmission: If TXTRIAT is set, TXTRI is set after the frame has been
fully transmitted, tristating the transmitter output. Tristating of the output can also be performed
automatically by setting AUTOTRI. If AUTOTRI is set TXTRI is always read as 0.