April 12, 2010
RS-485
Posted by: επισκευής : Κατηγορία: Serial Communications
Whereas RS-232 and RS-422 enable point-to-point serial links, the RS-485standard enables multiple-node networks. Like RS-422, RS-485 providesdifferential signaling to enable communications across spans of twisted-pairwire exceeding 1.2 km. Unlike RS-422, the RS-485 standard allows upto 32 transmit/receive nodes on a single twisted pair that is terminated at eachend as shown in Fig. 5.14. Modern low-load receivers that draw very littlecurrent from the RS-485 bus can be used to increase the number of nodeson an RS-485 network well beyond the original 32-node limit to 256 nodesor more. A single pair of wires is used for both transmit and receive, meaningthat the system is capable of half-duplex (one-way) operation rather thanfull-duplex operation (both directions at the same time). Half-duplex operationrestricts the network to one-way exchange of information at any given time.When node A is sending a packet to node B, node B cannot simultaneouslysend a packet to node A.
RS-485 directly supports the implementation of bus networks. Bus topologiesare easy to work with, because nodes can directly communicate with eachother without having to pass through other nodes or semi-intelligent hubs.However, a bus network requires provisions for sharing access to be builtinto the network protocol. In a centralized arbitration scheme, a master nodegives permission for any other node to transmit data. This permission can bea request-reply scheme whereby slave nodes do not respond unless a requestfor data is issued. Εναλλακτικά, slave nodes can be periodically queried bythe master for transmit requests, and the master can grant permissions on anindividual-node basis. There are many centralized arbitration schemes thathave been worked out over the years.A common distributed arbitration scheme on a bus network is collision detectionwith random back-off. When a node wants to transmit data, it ?rst waits untilthe bus becomes idle. Once idle, the node begins transmitting data. However,when the node begins transmitting, there is a chance that one or more nodeshave been waiting for an opportunity to begin transmitting and that they willbegin transmitting at the same time. Collision detection circuits at each nodedetermine that more than one node is transmitting, and this causes all activetransmitters to stop. ΕΙΚΟΝΑ 5.15 shows the implementation of an RS-485transceiver with external collision detection logic. A transmit enable signalexists to turn off the transmitter when the UART is not actively sending data.Unlike an RS-422 transmitter that does not have to share access with others,the RS-485 transmitter must turn itself off when not sending data to enableothers to transmit.
RS-485 directly supports the implementation of bus networks. Bus topologiesare easy to work with, because nodes can directly communicate with eachother without having to pass through other nodes or semi-intelligent hubs.However, a bus network requires provisions for sharing access to be builtinto the network protocol. In a centralized arbitration scheme, a master nodegives permission for any other node to transmit data. This permission can bea request-reply scheme whereby slave nodes do not respond unless a requestfor data is issued. Εναλλακτικά, slave nodes can be periodically queried bythe master for transmit requests, and the master can grant permissions on anindividual-node basis. There are many centralized arbitration schemes thathave been worked out over the years.A common distributed arbitration scheme on a bus network is collision detectionwith random back-off. When a node wants to transmit data, it ?rst waits untilthe bus becomes idle. Once idle, the node begins transmitting data. However,when the node begins transmitting, there is a chance that one or more nodeshave been waiting for an opportunity to begin transmitting and that they willbegin transmitting at the same time. Collision detection circuits at each nodedetermine that more than one node is transmitting, and this causes all activetransmitters to stop. ΕΙΚΟΝΑ 5.15 shows the implementation of an RS-485transceiver with external collision detection logic. A transmit enable signalexists to turn off the transmitter when the UART is not actively sending data.Unlike an RS-422 transmitter that does not have to share access with others,the RS-485 transmitter must turn itself off when not sending data to enableothers to transmit.

ΕΙΚΟΝΑ 5.14 RS-485 bus topology.

ΕΙΚΟΝΑ 5.15 RS-485 collision detection transceiver.
When transmitting, the receiver returns the logical state of the twisted-pair bus.If the bus is not at the same state as the transmitted data, a collision is mostlikely being caused by another transmitter trying to drive the opposite logicstate. An XOR gate implements this collection detect, and the XOR outputmust be sampled only after allowing adequate time for the bus to settle to astable state following the assertion of each bit from the transmitter.
Once a collision has been detected by each node and the transmitters aredisabled, each node waits a different length of time before retransmitting. Ifall delays were equal, multiple nodes would get caught in a deadlock situationwherein each node keeps trying to transmit after the same delay interval.Random back-off delays are pseudo-random so as to not unfairly burdensome nodes with consistently longer delays than other nodes. At the end ofthe delay, one of the nodes begins transmitting ?rst and gains control of thebus by default. The other waiting nodes eventually exit from their delaysand observe that the bus is already busy, indicating that they must wait theirturn until the current packet has been completed. If, by coincidence, anothernode begins transmitting at the same time that the ?rst node begins, theback-off process begins again. It is statistically possible for this processto occur several times in a row, although the probability of this being afrequent event is small in a properly designed network. A bus networkconstructed with too many nodes trying to send too much data at the sametime can exhibit very poor performance, because it would be quite proneto collisions. In such a case, the solution may be to either reduce the networktraf?c or increase the networks bandwidth.
Once a collision has been detected by each node and the transmitters aredisabled, each node waits a different length of time before retransmitting. Ifall delays were equal, multiple nodes would get caught in a deadlock situationwherein each node keeps trying to transmit after the same delay interval.Random back-off delays are pseudo-random so as to not unfairly burdensome nodes with consistently longer delays than other nodes. At the end ofthe delay, one of the nodes begins transmitting ?rst and gains control of thebus by default. The other waiting nodes eventually exit from their delaysand observe that the bus is already busy, indicating that they must wait theirturn until the current packet has been completed. If, by coincidence, anothernode begins transmitting at the same time that the ?rst node begins, theback-off process begins again. It is statistically possible for this processto occur several times in a row, although the probability of this being afrequent event is small in a properly designed network. A bus networkconstructed with too many nodes trying to send too much data at the sametime can exhibit very poor performance, because it would be quite proneto collisions. In such a case, the solution may be to either reduce the networktraf?c or increase the networks bandwidth.
δίπλα : E-book Complete_Digital_Design








































