RS232 or USB to RS485

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I need RS232 to RS485 converter or USB to RS485 converter, are there vendors
out there you recommend for these converters? More specifically, RS485 I am
using is 2-wire (ground, don't need 4-wire version) at 19200 baudrate.




Re: RS232 or USB to RS485
Quoted text here. Click to load it

RS-232 to RS-485 needs two simple chips back-to-back:
RS-232 to logic (e.g. MAX232) and logic to RS-485
(e.g. MAX485). The real problem comes from the control
of the RS-485 transmitter enable, if your interpretation
of two-wire RS-485 involves traffic in both directions
(which is 4-wire with transmit and receive bus lines
connected in parallel).

There are simple boxes which contain the chips and
usually a simple power supply (e.g. a plug transformer,
'wall wart'). Usually, they are four-wire, but the
common bus two-wire is achieved by connecting the
RS-485 bus sides in parallel. The boxes often control
the transmit enable with the RS-232 RTS (request to
send) signal.

HTH

Tauno Voipio
tauno voipio @ iki fi



Re: RS232 or USB to RS485
Quoted text here. Click to load it

Lately I see people here talking about 2-wire and 4-wire RS485. Isn't RS-485
*always* 2 wire?
If 4-wire, it's RS422, right?

Meindert



Re: RS232 or USB to RS485
Quoted text here. Click to load it

Right.

Sorry for giving up to the common misuse. I felt that
the OP was using the common incorrect terminology.

Tauno Voipio
tauno voipio @ iki fi



Re: RS232 or USB to RS485

Quoted text here. Click to load it

I show an example circuit, using those chips, at:
http://airborn.com.au/layout/232to485.html


Quoted text here. Click to load it

Yes, thats the way I see it also.  However, the basic
difference between RS485 and RS422 is that RS485 was
designed to have more than one transmitter - although
with only one transmitter active at a time.
RS485 allowed higher common mode voltages to achieve that,
together with parallel termination at each end.

It is possible to have 4 wire RS422, 2 wire RS485, or
4 wire RS485.  The 4 wire RS485 would typically have a
master (such as a PC) transmitting on one pair all the
time, and receiving on the other pair all the time,
with a number of connected slaves (such as field devices)
each receiving on one pair all the time, and transmitting
on the other pair only when they were supposed to.

One disadvantage of the 4 wire RS485 (besides the extra
two wires) is that no slave can see the other slaves
transmssions.  So by definition it is only good for
Master-Slave type protocols, not peer to peer protocols.
One advantage is that the Master or "PC" does not need
to control its transmit line - it can transmit all the time.

Regards
Steve

http://www.airborn.com.au



Re: RS232 or USB to RS485
On Wed, 11 Feb 2004 08:20:53 +0100, "Meindert Sprang"

Quoted text here. Click to load it

No.

RS-422 is point to point with the transmitters always on.

"4 wire RS-485" usually refers to a single RS-422 master (with Tx
always on) and multiple slaves with one pair constantly listening to
the master transmission on the master Tx pair, but the slave
transmitters can be tri-stated and all slave Tx chips are connected in
parallel to the master Rx pair.

The master can communicate with a single selected slave at the time in
full duplex. Alternatively, the master can send broadcasts to all
slaves and simultaneously receiving data from a single slave.

I have not read the actual standard to check if 4 wire RS-485 actually
is standardised, but this name is often used in practice for 4 wire
multidrop systems.

Paul
 

Re: RS232 or USB to RS485
Quoted text here. Click to load it
RS-485
Quoted text here. Click to load it

Thanks for that very clear explanation. The 4-wire RS485 is something I
never thought of.
It has indeed its advantages.

Meindert



Re: RS232 or USB to RS485

Quoted text here. Click to load it

No.  If you use separate RS485 driver/receiver chips and two
pairs, then it's four wire.

Quoted text here. Click to load it

Not quite.  IIRC, there are some minor differences in the
electrical specs.  RS-422 often won't allow multi-drop, and is
strictly a point-to-point connection.

--
Grant Edwards                   grante             Yow!  You should all JUMP
                                  at               UP AND DOWN for TWO HOURS
We've slightly trimmed the long signature. Click to see the full one.
Re: RS232 or USB to RS485

Quoted text here. Click to load it


I don't agree this would mean "it" (RS485) is 4-wire, then.  

It's really two independent RS485 links, using 2 wires each.  The fact
you're not using full-fledged transceiver chips on your nodes is not a
feature of the RS485 line protocol as such --- it's a detail of the
particular application.

You wouldn't call a bundle of ten classical coaxial Ethernet cables
used to connect ten machines to ten other ones a "10-coax Ethernet"
connection either, would you?



--
Hans-Bernhard Broeker ( snipped-for-privacy@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.

Re: RS232 or USB to RS485

Quoted text here. Click to load it

True (from an electrical point of view).  

But out in industry, that's called "4-wire RS-485", and it's
quite common.  It's usually used for a single-master, multiple
slave system.  The master transmits on one pair, the slaves on
the other.

Quoted text here. Click to load it

You misunderstand.  The two pair in 4-wire rs-485 aren't used
to connect two machines to two other machines.

The two pair form a single bus with one master and multiple
slaves. Electrically, it may be two RS-485 busses.  Logically,
it's a single, 4-wire bus that happens to use RS-485
transceivers.

--
Grant Edwards                   grante             Yow!  I decided to be JOHN
                                  at               TRAVOLTA instead!!
We've slightly trimmed the long signature. Click to see the full one.
Re: RS232 or USB to RS485
On 11 Feb 2004 14:34:00 GMT, Hans-Bernhard Broeker

Quoted text here. Click to load it

RS-232, RS-485 and RS-422 are not protcol definitions. Something like
HDLC and Ethernet are  protocols. If you add the 10base-T and 10base-2
to ethernet you get physical/electrical definition as well.  

Regards
   Anton Erasmus


Re: RS232 or USB to RS485
On Wed, 11 Feb 2004 07:13:55 GMT, Tauno Voipio

Quoted text here. Click to load it


I have found that the converters using RTS to enable are not very
useful to me.  It is not possible to use them with Hyperterminal in
windows because when hardware handshaking is turned on, RTS is
permenantly asserted, so bi-directional transfer is impossible.

It is also not possible to use them with windows application, because
it is impossible to know when to reset the RTS line, because the
application has no way to know exacltly when all data has been
transmitted out the serial port.

I think the only way to make a useful RS-232 to RS-485 adapter for
windows is to use a hardware one-shot triggered by the start bit to
control Transmit enable on RS-485 driver.  Please let me know if I am
wrong.

regards,
Johnny.

Re: RS232 or USB to RS485
snipped-for-privacy@iki.fi.NOSPAM.invalid> wrote:
Quoted text here. Click to load it


Also, windows handling of timing for RTS is abysmal
So even when RTS is not permanently enabled, and when
the app DOES know when the packet has finished, the
COMMs don't work very well.

Quoted text here. Click to load it

But the one shot mustn't be retriggerable - and given
possible variation in baud rate, the most reliable
way to do it is using a microprocessor.  Not very easy.

Regards
Steve

www.airborn.com.au



Re: RS232 or USB to RS485

Quoted text here. Click to load it

Personally, I have found Hyperterminal a real PITA, and highly inconsistent.
There are a hundred and one free terminal programs for windows that are far
better (and as many again commercial ones).  At the risk of starting yet
another "my terminal program is better than your terminal program" thread,
I'd recommend "Tera Term Pro" for most serial work (because it is small,
fast, neat, and does what enough for most jobs without doing too much) and
"RealTerm" for more complex work (because it is big, powerful, with more
options than I could imagine needing).  In particular, "RealTerm" supports
RTS control of RS-485 lines as you want here.

Quoted text here. Click to load it

It is perfectly possible to do exactly that - when setting the DCB flags in
a SetCommState api call, you can choose to have the RTS line permanently
high, or low, or hardware handshaking, or to have it active whenever there
is something being sent out and deactivated when there is nothing being
transmitted.  It is simply a matter of choosing that flag, and your RS-485
communication should work perfectly.  I haven't done any measurements as to
the exact timings on the line, but I have found it far more reliable than
using so-called "intelligent" RS-485 adaptors.

Now, if anyone can tell me how to get the same effect in linux, I'd be most
interested!

David


Quoted text here. Click to load it



Re: RS232 or USB to RS485
To control RTS, I wrote my own program that uses DCB flag in one of those
Windows API calls. Definitely don't want to use HYPERTERMINAL to toggle RTS.
Have not measured exact timing yet, but it worked as I intended.

My original post was to find commercially avialable RS232-485 converter. We
have built in-house version of such a converter, but it takes longer to
build it internally than buy it somewhere else...

QBA

Quoted text here. Click to load it
inconsistent.
far
in
to
most




Re: RS232 or USB to RS485
On Wed, 11 Feb 2004 09:25:08 +0100, "David Brown"

Quoted text here. Click to load it



David,

Is there any special setup for the UART hardware required to make this
work?

As Paul K wrote below: " the 16550 family UARTs (as usually used in
PC:s) are more or less useless for controlling the RTS/DTR".

Actaully I have never done any windows programming, but the windows
programmer working on my project dosen't know anything about hardware,
so I would like to design out these hardware problems if they are
going to be an issue.

regards,
Johnny.



Re: RS232 or USB to RS485

Quoted text here. Click to load it
inconsistent.
far
thread,
and
supports
in
there
RS-485
Quoted text here. Click to load it
to

I don't actually know how it is implemented by windows - but nothing more is
needed that setting the right flags in the Windows API call to setup the
comms port.  There are various ways it could be implemented, such as waiting
a character time after the final interrupt to give the last character a
chance to get out, or sending an extra dummy character into the queue and
switching off RTS before it gets sent.




Re: RS232 or USB to RS485


Quoted text here. Click to load it

Doesn't the "standard" windows serial port driver have an
RTS-toggle feature?  I know the Windows serial drivers we did
at a previous employer did.

--
Grant Edwards                   grante             Yow!  Th' MIND is the Pizza
                                  at               Palace of th' SOUL
We've slightly trimmed the long signature. Click to see the full one.
Re: RS232 or USB to RS485

Quoted text here. Click to load it

At least in some old modem system (for which RS-232 was originally
designed), the DTE (computer) raises the RTS signal to advertise that
it has something to send. The DCE (modem) returns sooner or later this
request by rising the CTS, which then enables the UART Tx shift
register. Once enabled, the whole character is transmitted regardless
of the CTS state.

Once the last character has started to be transmitted, there is no
need to request for permission for more characters and the RTS can be
dropped at any convenient time, even during the transmission of the
last character.

This is quite sufficient for RTS/CTS handshaking, but not very usable
for controlling the RS-485 transmitter, since the transmitter could be
disabled too early, cutting out the last bits.
 
My guess is (without checking with an oscilloscope) that the Windows
driver simply drops the DTR when the last character has been
transferred from the Tx register to the Tx shift register, which on
16550 style chips can generate an interrupt. I very much doubt that
the driver would run in a busy loop constantly checking the UART
status register to find out, when the last stop bit has actually been
sent. Such busy looping might be acceptable in MS-DOS type single
thread systems but not in multitasking operating systems.

Paul
        

Re: RS232 or USB to RS485

Quoted text here. Click to load it


[...]

That's what I've been told the Windows serial driver does: It
checks the shfit-register empty status bit every millisecond
until true, then drops RTS.

Sure, it sucks, but that's how you have to do it when you've
got a crippled UART.

--
Grant Edwards                   grante             Yow!  Now, let's SEND OUT
                                  at               for QUICHE!!
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline