Re: linux and rs-485
From: Paul Keinanen (keinanen_at_sci.fi)
Date: Tue, 05 Aug 2003 19:15:58 +0300
On Tue, 05 Aug 2003 14:43:18 +0200, Bernhard Roessmann
>Is there really no chance to control RTS in a right and efficient way?
You either need a special UART in which the Tx shift register empty
status bit directly controls the RTS signal, which then controls the
transmit enable/Rx disable pin, use an external intelligent RS-232/485
controller or use the tri-state trick, which is not standard
Using a proper RS-485 card with proper hardware handshake is the
The intelligent external converter counts the number of bits after the
start bit to find out when the (last) stop bit ended and then disable
the transmitter, if no new start bit appear immediately after the last
stop bit of the previous character. The converter needs to know the
line speed and character length (number of data bits, parity bit and
stop bits) in order to know when the character has been completed.
Usually these are set by a DIL switches.
The quick and dirty (non conforming) alternative is to control the RTS
(Transmit enable) pin directly by the RS-232 TX data stream. The
transmitter is activated only when the Space ("0") bit is to be
transmitted. When the RS-232 Tx pin is in the Mark ("1") bit state,
the RS-485 transmitter is disabled and it goes to tri-state. The
pull-up/pull-down resistors will set the line to the Mark state and
the receiver(s) will sense the "1" bit. This trick does of course not
conform to the RS-485 standard, but it works in many situations. You
may have to do your own echo cancellation in software if the RTS pin
does not disable the receiver.