> 2010/7/6 Ruben Jönsson <
.....rubenKILLspam
.....pp.sbbs.se>:
>>> Hi all,
>>>
>>> I'm creating an RS485 network consisting of a few devices, used for
>>> temperature sensing and control. I want this to be RS485 because it's
>>> simple and I already have the parts/protocols mostly in place. As of
>>> now, it does not need to be multi master, however, I want to leave the
>>> option open.
>>
>> You also need to specify the maximum speed.
>>
>>>
>>> 1. Should I use a half duplex or full duplex RS485 transceiver? I'm
>>> not really sure how full duplex RS485 would work for multiple nodes (4
>>> or 5 nodes) and what the advantages would be.
>>
>> Half duplex is two wires + ground and possibly shield. Both transmitter and
>> receiver on all nodes uses the same wires for communication. Only one can talk
>> at a time. Half duplex is the most common for RS485 networks.
>>
>> Full duplex is 4 wires + ground and possibly shield. I have only seen this used
>> in systems where there is a single master and multiple slaves. From the masters
>> point of view it has two dedicated wires for tx and two for rx. This means that
>> the master can receive and transmitt at the same time. The tx on the master is
>> connected to the rx on all slaves and the rx on the master is connected to tx
>> on all slaves. This has the advantage that the master can keep the tx driver
>> enabled all the time and if the master is a PC this can make the software much
>> easier to write since there is no built in mechanism in a PC to handle
>> enabling/disabling of the tx drivers (the software works just like with RS232).
>> The turnaround of the tx lines on the slave nodes still have to be handled
>> though.
>>
>>>
>>> 2. Should I use twisted pair telephone cable or Ethernet cable? Or any
>>> other suggestions?
>>
>> You should use twisted pairs but you also need a third ground wire which
>> connects the ground(plane)s between all your nodes. This can become a problem
>> if the nodes are not floating and/or there is a voltage difference between the
>> grounds on the nodes in the network. A lot of people will tell you that you
>> only need two wires for RS485 and many times this will work. However, a proper
>> RS485 network needs a common ground wire - it is not a current loop. There is
>> more on this in the linked articles below. If there is a problem with different
>> ground levels in your nodes you can use isolated RS485 transcievers. If you can
>> build your nodes with an isolated power supply (mains transformer) or you can
>> supply all nodes from the same power supply and the nodes are not directly
>> connected to other devices you should be fine.
>>
>> If you use a shield, it should be connected at both ends to a solid ground
>> (earth) which is usually the metal frame around a system (chassis). This may or
>> may not be the same as the ground wire (which is connected to the ground plane
>> on the boards). This can also mean that you will get problems with ground
>> currents (ground loops) where the ground (earth) potential is at different
>> levels on different nodes. This can be prevented by DC decoupling the shield
>> with a capacitor (but it is rarely needed if the nodes are within a relatively
>> close area) and it is also usually a lot harder to get a good EMC result with
>> this setup.
>>
>> You can use a shielded or unshielded cable with two twisted pairs where one
>> pair is for communication in the half duplex network and the other pair is for
>> power.
>>
>>>
>>> 3. How should all of the "lines" be connected? How about a "junction
>>> box" which consists of a PCB with a bunch of sockets all connected
>>> together? It's simple and clean enough, but I don't know if the
>>> untwisted traces on the PCB will cause any trouble.
>>
>> You should connect all the nodes in series with short stubs (bus topology) and
>> not as a star network. When I say "in series" I mean on a long bus without
>> stubs or trunks - although the nodes are theoretically connected in parallell.
>> I usually have terminals for an incomming and an outgoing bus line on each node
>> that are actually connected in parallell on the board. If you have lots of
>> nodes the (very low) series resistance introduced in the bus by the terminals
>> could become a problem. Then you could just use one terminal and connect both
>> the incomming and outgoing wires together in that terminal. This is mostly a
>> problem if you supply all boards with power on the bus wires and each node
>> consumes relatively high power. The low series resistance is not a problem for
>> the communication wires.
>>
>> The tx pair should be terminated at the far ends (only one place) with a
>> termination resistor that matches the cable (usually around 120 ohms). If you
>> use half duplex there is only one pair and it should be terminated at both
>> ends.
>>
>> At one place on the bus (usually on the master in a single master system or at
>> one end on the bus) there should also be some weak pullup and down resistors to
>> guarantee that the bus is read as idle when all transmitter drivers are in the
>> off state. I usually have two jumpers on the node boards which are both used
>> together to connect the termination resistor and also the pull up/down
>> resistors.
>>
>> The RS485 transcievers are pretty tolerant for common mode voltages (-7V to
>> +12V) but this is not always enough. I always put some low value resistors and
>> three high powered double (antiparallell) tvs's on each node (two between the
>> communication lines and ground and a third between the lines themselves).
>>
>> For some good, solid information about RS485 networks see the following links:
>>
>> <
http://www.national.com/an/AN/AN-1057.pdf>
>>
>> <www.circuitcellar.com/library/ccofeature/perrin0799/c79bppdf.pdf>
>>
>> /Ruben
>
> Thanks a lot for the detailed reply. I took a look at the links you gave me.
>
> The way that the network nodes will be placed will make a star
> topology the most convenient choice. What's the disadvantage of a star
> topology?
>
> Also, if there are only two devices, and a direct RS485 connection
> between them (distances anywhere from 1 m to 1000 m) over a twisted
> pair line, does the line need anything special? That is, does it need
> to be terminated? If so, how do you terminate a point to point line?
>