...the world's most energy friendly microcontrollers
2014-07-02 - Gecko Family - d0001_Rev1.30
214
www.silabs.com
• 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.
Note
When in SmartCard mode with repeat enabled, none of the actions, except generate break,
will be performed until the frame is transmitted without failure. Generation of a break in
SmartCard mode with repeat enabled will cause the USART to detect a NACK on every
frame.
16.3.2.4 Data Reception
Data reception is enabled by setting RXEN in USARTn_CMD. When the receiver is enabled, it actively
samples the input looking for a transition from high to low indicating the start baud of a new frame. When
a start baud is found, reception of the new frame begins if the receive shift register is empty and ready
for new data. When the frame has been received, it is pushed into the receive buffer, making the shift
register ready for another frame of data, and the receiver starts looking for another start baud. If the
receive buffer is full, the received frame remains in the shift register until more space in the receive
buffer is available. If an incoming frame is detected while both the receive buffer and the receive shift
register are full, the data in the shift register is overwritten, and the RXOF interrupt flag in USARTn_IF
is set to indicate the buffer overflow.
The receiver can be disabled by setting the command bit RXDIS in USARTn_CMD. Any frame currently
being received when the receiver is disabled is discarded. Whether or not the receiver is enabled at a
given time can be read out from RXENS in USARTn_STATUS.
16.3.2.4.1 Receive Buffer Operation
When data becomes available in the receive buffer, the RXDATAV flag in USARTn_STATUS, and
the RXDATAV interrupt flag in USARTn_IF are set, and when the buffer becomes full, RXFULL in
USARTn_STATUS and the RXFULL interrupt flag in USARTn_IF are set. The status flags RXDATAV
and RXFULL are automatically cleared by hardware when their condition is no longer true. This also
goes for the RXDATAV interrupt flag, but the RXFULL interrupt flag must be cleared by software. When
the RXFULL flag is set, notifying that the buffer is full, space is still available in the receive shift register
for one more frame.
Data can be read from the receive buffer in a number of ways. USARTn_RXDATA gives access to the
8 least significant bits of the received frame, and USARTn_RXDOUBLE makes it possible to read the 8
least significant bits of two frames at once, pulling two frames from the buffer. To get access to the 9th,
most significant bit, USARTn_RXDATAX must be used. This register also contains status information
regarding the frame. USARTn_RXDOUBLEX can be used to get two frames complete with the 9th bits
and status bits.
When a frame is read from the receive buffer using USARTn_RXDATA or USARTn_RXDATAX,
the frame is pulled out of the buffer, making room for a new frame. USARTn_RXDOUBLE and
USARTn_RXDOUBLEX pull two frames out of the buffer. If an attempt is done to read more frames from
the buffer than what is available, the RXUF interrupt flag in USARTn_IF is set to signal the underflow,
and the data read from the buffer is undefined.
Frames can be read from the receive buffer without removing the data by using USARTn_RXDATAXP
and USARTn_RXDOUBLEXP. USARTn_RXDATAXP gives access the first frame in the buffer with
status bits, while USARTn_RXDOUBLEXP gives access to both frames with status bits. The data read
from these registers when the receive buffer is empty is undefined. If the receive buffer contains one
valid frame, the first frame in USARTn_RXDOUBLEXP will be valid. No underflow interrupt is generated
by a read using these registers, i.e. RXUF in USARTn_IF is never set as a result of reading from
USARTn_RXDATAXP or USARTn_RXDOUBLEXP.
Summary of Contents for EFM32G
Page 505: ......