English
Language : 

DAN-190 Datasheet, PDF (3/6 Pages) Exar Corporation – EXAR UARTS IN RS-485 APPLICATIONS
DAN190
EXAR UARTS IN RS-485 APPLICATIONS
3.1.3 Auto RS-485 Half-Duplex Direction Control Feature
The most efficient way to use a UART in a half-duplex RS-485 environment is to use an Exar UART that has
the Automatic RS-485 Half-Duplex Direction control feature. This feature changes the behavior of the UART in
two ways.
■ The behavior of one of the UART outputs becomes a control signal to control the direction of the RS-485
transceiver. While the UART is idle, the control output will enable the receive mode of the RS-485
transceiver. When any data is loaded into the TX FIFO, the control output will automatically enable the
transmit mode of the RS-485 transceiver. Once the UART has sent all of the data in the TX FIFO and
TSR, the control output will automatically change RS-485 transceiver back to the receive mode.
■ The behavior of the transmit empty interrupt changes. Instead of generating an interrupt when the TX
FIFO is empty, the interrupt is generated when the TX FIFO and TSR register are both empty and the
transmitter is completely idle.
The only thing that needs to be done is:
//Initialization
Enable Auto RS-485 Half-Duplex Direction control;
The direction of the transceiver will be taken care of automatically by the UART so that the CPU/MCU can
perform other tasks.
FIGURE 3. UART TRANSMIT INTERRUPT BEHAVIOR WITH AUTO RS-485 FEATURE
TX FIFO
EMPTY
TX FIFO empty interrupt
generated here
TX FIFO
TSR EMPTY
TSR
TX output
4.0 OTHER FEATURES
4.1 RS-485 Direction Control Outputs
Not all UARTs with the Auto RS-485 Half-Duplex Direction Control Feature use the same output to control the
direction of the RS-485 transceiver. Most UARTs use the RTS# output. But some UARTs can use the DTR#
output or OP1# output. The table on the next page lists the different outputs that can be used for the Auto RS-
485 Half-Duplex Direction control output.
4.2 RS-485 Direction Control Polarity
The polarity of the control output also varies depending on the UART. For some UARTs, the control output is
HIGH for transmit mode and LOW for receive mode. However, there are some UARTs where it is the opposite
polarity. If the RS-485 control output is in the wrong state, then an external inverter may be required. To
eliminate this external inverter, some newer UARTs have a register bit that can invert the default polarity of the
Auto RS-485 Half-Duplex Direction Control output.
4.3 UARTs with Enable RS-485 pins
Upon power-up, the control output of the UART may be in the incorrect state until it has been initialized. During
this time, the UART may be unintentionally driving the RS-485 network preventing the other nodes from
communicating. For the systems that require the RS-485 control output to be in the correct state upon power-
up, some UARTs have the Auto RS-485 enable pin. The UARTs that have this pin are also noted in the table
on the next page.
3