AW: The RS485 driver problem...

Martin Krause Martin.Krause at tqs.de
Wed Feb 2 19:27:59 EST 2005


Hi David,

linuxppc-embedded-bounces at ozlabs.org wrote on :
> If you want to connect a RS485 transceiver to a normal UART, you
> always have the problem of dealing with enabling/disabling
> transmitter and recveiver. I have seen hardware that misuses RS-232
> hardware handshaking lines (RTS/CTS) for this purpose. What I have
> not been able to find is a linux driver or software solution to this
> problem. 
> 
> Has anybody used the CPM uarts (or even a standard 16C550 uart) for
> this purpose? How?

Yes, we used normal UARTs several times to form a RS485 interface. It 
is a bit tricky, because you must disable the transmitter just in time
after the last bit of a message has been left the transmit shift
register. Otherwise the answer from the addressed bus node could be
(partly) overwritten. It depends on your bus protocol how much time
you could afford to disable the transmitter. Since linux is not a
real time OS, and the transmitter is controlled by software (we use
an GPIO for this), there is no guarantee that this works under all
circumstances fast enough.
For us it is working well with a baudrate of 38.400 und a maximum
time of < 400 us to disable the transmitter after sending a message. 
We used a 16752 UART. The driver could be found in the 'linuxarm' 
kernel tree on the Denx CVS server (look at www.denx.de). If you 
couldn't use CVS I could send you the driver sources directly.

Regards,
Martin



More information about the Linuxppc-embedded mailing list