EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

RS232 to RS485 conversion, RTS as control line.

Started by Ajab January 9, 2008
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.
"Ajab" <jasusvijay@yahoo.com> wrote in message 
news:baa95dd0-9c65-4799-9047-987370afeac8@e10g2000prf.googlegroups.com...
> 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.
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
On Jan 9, 8:46=A0pm, "Not Really Me"
<sc...@validatedQWERTYsoftware.XYZZY.com> wrote:
> "Ajab" <jasusvi...@yahoo.com> wrote in message > > news:baa95dd0-9c65-4799-9047-987370afeac8@e10g2000prf.googlegroups.com... > > > > > 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. > > One end or the other must be controlling RTS. =A0Ideally it should be your=
> end. =A0Where does your RTS signal come from? =A0If 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 mus=
t
> be sure the last character has finished transmitting. =A0Not all micros ha=
ve a
> signal to indicate that the xmit shift register is empty. =A0Some only > indicate that the internal xmit buffer is empty. =A0If this is true you mu=
st
> add a software delay based on your transmission speed. > You also need to allow for turn-around time of the max3456 and whatever yo=
u
> are connected to. =A0Not all transceivers switch instantly. =A0There could=
be a
> delay of milliseconds for the lines to completely switch. > Scott- Hide quoted text - > > - Show quoted text -
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?
On Wed, 9 Jan 2008 19:03:32 -0800 (PST), Ajab <jasusvijay@yahoo.com>
wrote:

>On Jan 9, 8:46&#4294967295;pm, "Not Really Me" ><sc...@validatedQWERTYsoftware.XYZZY.com> wrote:
>> Also, remember that when you control RTS to change direction, that you must >> be sure the last character has finished transmitting. &#4294967295;Not all micros have a >> signal to indicate that the xmit shift register is empty. &#4294967295;Some only >> indicate that the internal xmit buffer is empty. &#4294967295;
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.
>>If this is true you must >> add a software delay based on your transmission speed.
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.
>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?
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

The 2024 Embedded Online Conference