> 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 t= alk = 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 mas= ters = 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 drive= r = enabled all the time and if the master is a PC this can make the software m= uch = 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 RS2= 32). = 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 probl= em = 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 pro= per = 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 diffe= rent = 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 c= an = 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 ma= y or = may not be the same as the ground wire (which is connected to the ground pl= ane = 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 shiel= d = with a capacitor (but it is rarely needed if the nodes are within a relativ= ely = close area) and it is also usually a lot harder to get a good EMC result wi= th = 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 paralle= ll. = 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 termina= ls = could become a problem. Then you could just use one terminal and connect bo= th = 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 y= ou = 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 resistor= s 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 use= d = 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 t= he = communication lines and ground and a third between the lines themselves). For some good, solid information about RS485 networks see the following lin= ks: = /Ruben =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D Ruben J=F6nsson AB Liros Electronic Box 9124, 200 39 Malm=F6, Sweden TEL INT +46 40142078 FAX INT +46 40947388 ruben@pp.sbbs.se =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist