...the world's most energy friendly microcontrollers
2014-07-02 - Gecko Family - d0001_Rev1.30
258
www.silabs.com
When communicating over a single data-link, the transmitter must thus be tristated whenever not
transmitting data. If AUTOTRI in LEUARTn_CTRL is set, the LEUART automatically tristates LEUn_TX
whenever the transmitter is inactive. It is then the responsibility of the software protocol to make sure
the transmitter is not transmitting data whenever incoming data is expected.
The transmitter can also be tristated from software by configuring the GPIO pin as an input and disabling
the LEUART output on LEUn_TX.
Note
Another way to tristate the transmitter is to enable wired-and or wired-or mode in GPIO.
For wired-and mode, outputting a 1 will be the same as tristating the output, and for wired-
or mode, outputting a 0 will be the same as tristating the output. This can only be done on
buses with a pull-up or pull-down resistor respectively.
18.3.7.2 Single Data-link with External Driver
Some communication schemes, such as RS-485 rely on an external driver. Here, the driver has an extra
input which enables it, and instead of Tristating the transmitter when receiving data, the external driver
must be disabled. The USART has hardware support for automatically turning the driver on and off.
When using the LEUART in such a setup, the driver must be controlled by a GPIO. Figure 18.6 (p. 258)
shows an example configuration using an external driver.
Figure 18.6. LEUART Half Duplex Communication with External Driver
LEUART
RX
TX
µC
GPIO
18.3.7.3 Two Data-links
Some limited devices only support half duplex communication even though two data links are available.
In this case software is responsible for making sure data is not transmitted when incoming data is
expected.
18.3.8 Transmission Delay
By configuring TXDELAY in LEUARTn_CTRL, the transmitter can be forced to wait a number of bit-
periods from it is ready to transmit data, to it actually transmits the data. This delay is only applied to the
first frame transmitted after the transmitter has been idle. When transmitting frames back-to-back the
delay is not introduced between the transmitted frames.
This is useful on half duplex buses, because the receiver always returns received frames to software
during the first stop-bit. The bus may still be driven for up to 3 baud periods, depending on the current
frame format. Using the transmission delay, a transmission can be started when a frame is received,
and it is possible to make sure that the transmitter does not begin driving the output before the frame
on the bus is completely transmitted.
18.3.9 DMA Support
The LEUART has full DMA support in energy modes EM0 – EM2. The DMA controller can write to the
transmit buffer using the registers LEUARTn_TXDATA and LEUARTn_TXDATAX, and it can read from
receive buffer using the registers LEUARTn_RXDATA and LEUARTn_RXDATAX. This enables single
Summary of Contents for EFM32G
Page 505: ......