English
Language : 

DAN-190 Datasheet, PDF (1/6 Pages) Exar Corporation – EXAR UARTS IN RS-485 APPLICATIONS
DAN190
EXAR UARTS IN RS-485 APPLICATIONS
April 2008
EXAR UARTS IN RS-485 APPLICATIONS
1.0 INTRODUCTION
This application note discusses the benefits of Exar's patented Automatic RS-485 Half-Duplex Direction
Control feature (patent #6,765,626) available in Exar's enhanced UARTs and how this feature simplifies the
software driver implementation for using UARTs in a half-duplex RS-485 environment.
2.0 HARDWARE CONNECTIONS
Figure 1 below shows the typical connection of a UART to a half-duplex RS-485 transceiver. The same output
from the UART will control both the Driver Enable (DE) and Receiver Enable (RE#) inputs to guarantee that the
RS-485 transceiver is only either transmitting or receiving.
FIGURE 1. TYPICAL CONNECTION BETWEEN UART AND RS-485 TRANSCEIVER
TX
TX
(RS-485 Direction
DE
Control Output)
RE#
RX
RX
TX+ / RX+
TX- / RX-
UART
RS-485
Transceiver
3.0 SOFTWARE CHALLENGES
The main challenge for using a UART in a half-duplex RS-485 environment is making sure that the RS-485
transceiver is in the TX mode before transmitting and that the RS-485 transceiver does not return to the RX
mode until all of the data has been transmitted. The industry standard 16550 UARTs generate an interrupt
when the TX FIFO is empty, however, there may still be data in the Transmit Shift Register (TSR). Therefore,
some additional software is required to ensure that the TSR is also empty when using a UART that does not
have Exar’s Auto RS-485 Half-Duplex Direction Control Feature.
FIGURE 2. UART TRANSMIT INTERRUPT BEHAVIOR
TX FIFO
EMPTY
TX FIFO empty interrupt
generated here
TX FIFO
DATA
TSR
TX output
1