The RS485 driver problem...

Mark Chambers markc at mail.com
Thu Feb 3 00:15:11 EST 2005


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?

I took a look at some old non-linux code for the MPC860, and it appears
that the RTSM bit in GSMR_H provides switched-RTS in UART mode.
It will negate RTS after the last character in a BD.  (SCCs only, not SMC)

Another trick you can use, depending on your hardware config, is to loop
your transmit data back to receive.  When you receive the last character
you sent you know it's safe to turn off RTS, and since you're getting an
interrupt it's deterministic.

Mark Chambers




More information about the Linuxppc-embedded mailing list