RS232 to RS485 conversion, RTS as control line.

Hi people,

I am using a MAX3221 IC to convert RS232 to TTL and MAX3465 full duplex IC to convert TTL to RS485. Shorted TX+, RX+ and TX-, RX- for 2- wire RS485 protocol. RTS line is used for controlling enable of max3465. DE and ~RE are given to TTL RTS. But the RTS always remains high.. so for max3465 driver will be always enabled....... So how the receiver portion will work, because RTS doesn't go low..... I am using none option in hyperterminal for flow control. How do i use software control...??? To check using loopback...i am giving 2-wire rs485 o/p to another 2- wire rs485 (+ to + and - to -) to rs232 converter. then looping back rs232 tx-rx. will this work? I am not getting loopback or any data. Please let me know if you have any inputs. Thanks.

Reply to
Ajab
Loading thread data ...

One end or the other must be controlling RTS. Ideally it should be your end. Where does your RTS signal come from? If you are using a microcontroller then it is most likely that you must manually switch the signal through the modem control register in your micro. Also, remember that when you control RTS to change direction, that you must be sure the last character has finished transmitting. Not all micros have a signal to indicate that the xmit shift register is empty. Some only indicate that the internal xmit buffer is empty. If this is true you must add a software delay based on your transmission speed. You also need to allow for turn-around time of the max3456 and whatever you are connected to. Not all transceivers switch instantly. There could be a delay of milliseconds for the lines to completely switch. Scott

Reply to
Not Really Me

t

ve a

st

u

be a

No i am not using microcontroller. I am using serial port from PC......RS232 tx,rx,RTS are converted in TTL using max3221. then this ttl o/p is given as rx,tx and DE+ ~RE of max 3465 resp. Any way to control RTS? Can I control the RTS through PC?

Reply to
Ajab

The 14550 style UARTs typically found on PCs only generate an interrupt when the last character is transferred from the transmit buffer to the transmit shift register. The Tx shift register empty status is only available as a status bit, not as an interrupt.

For proper operation, you would have to monitor this bit in a busy loop, which would usually be OK in MS-DOS, but not very nice on any multitasking operating system.

For 9600 bit/s, you would have to generate a 1 ms delay and for higher speeds even shorter delays, not possible in Windows operating systems.

Boot the PC into MS-DOS and use some proper terminal program that checks the status of the Tx shift register.

For Windows/Linux use a PCI card with proper RS-485 interface, These usually have automatic transceiver data direction control built in.

If everything else fails, the RS-485 bus can be driven in the same way as the CAN bus is driven. The RS-485 transceiver data direction control pin is connected to the transmit data pin (possibly through an inverter) and is driven actively only when Space ("0") is transmitted and when the TX-data is in Mark ("1") state, the RS-485 transceiver is in tri-state mode and the bus is driven into Mark state by the "fail-safe" termination resistors (which must be installed for proper operation in this mode). The noise margin will be worse than with proper bus driving and the receiver pin may also contain your own transmission, which must be removed by software.

Paul

Reply to
Paul Keinanen

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.