Tuesday, December 14, 2010

【 Weak current College 】-485 interface circuit of hardware design 】


Match 1) bus, bus matches there are two ways, one is combined with matching resistor, located in the bus at both ends of the difference between VA and VB port should match resistor 120 Ω crossover, to reduce mismatch due to reflection, absorption, noise, effectively suppresses noise interference, but matching resistor consumes large current, does not apply to the power limit strict system, the other a saving of match is a match with a RC capacitance C partition DC component, you can save most of the power, but the value of the capacitor C is a pain, the need for power and quality tradeoff between matches, in addition to the above two, there is also a match using the diode, which although not true match, but it uses the role of the clamp diode, rapidly weakening reflecting signal reaching the aim of improving signal quality, energy-saving effect is significant,

2) RO and DI-configure a pull-up resistor, asynchronous communication data to byte means of transmitting, in every byte transferred before, first through a low level initiation for handshake, to prevent the interference signal error triggered RO (receiver output) negative hopping, the receiving end of the entry into the receiving State, MCU recommends RO external 10 k Ω pull-up resistor,

3) to ensure that the system is electrified RS-485 chip is in the receive input status, for transceiver control-TC recommended MCU PIN through the inverter control, should not be used for direct control MCU pin, to prevent the MCU is electrified on bus interference,

4) bus isolation, RS-485 bus-and received-two-wire interface, once a chip failure might be bus "La death," and so on second line of VA and VB and bus should be isolated, usually in VA and VB and bus between threaded a 4 ~ 10 Ω for PTC resistor, at the same time and the crossover between the TVS diode, 5V to remove line surge interference, in the absence of PTC resistance and TVS diodes, resistors and voltage available ordinary place, 5 pipes) reasonable choice of chip, for example, on an external device to prevent strong electromagnetic (lightning), it is proposed to adopt the TI 75LBC184, lightning chip, the number of nodes required more optional SIPEX's SP485R,

2RS-485 network configuration 1) network nodes and network nodes and the selected RS-485 chip driver and receiver input impedance, such as 75LBC184 nominal maximum is 64 points, SP485R nominal maximum of 400 points, actually used, because the cable length, diameter, network distribution, transfer rate, the actual number of nodes may not reach the theoretical value, such as application in 75LBC184 500m distribution of RS-485 network more than 50 on a node or a rate greater than 9.6kb/s, noticeable decline, reliability is often recommended nodes by RS-485 chip maximum 70% of selection, transfer rate in 1200 ~ 9600b/s distance between selection, communications, from communication within 1km efficiency, nodes, communication distance, and so on comprehensive consider 4800b/s best, communication distance 1km above, consideration should be given by increasing the relay module or reduce the rate of increase data transfer reliability,

2) node and trunk distance, in theory, RS-485 node and the distance between the trunk (T head, also known as PIN) as short as possible, T head is smaller than the node using 10m T-type, a connection to the network matching little bearing, can rest assured that the use, but for node spacing is very small (less than 1m, such as the LED module combination screens) should be used in a star join, the use of t-or wire-connection is not working, RS-485 is a half-duplex structure communication bus, mostly used for a one-point communication system, so the host (PC) should be placed at the end, not in the middle to form the backbone of the t-distribution, improve communication efficiency RS-485 3

RS-485 is typically applied to a one-point-slave response-communication system, as opposed to full-duplex bus RS-232 etc many low efficiency, and therefore the selection of appropriate communication protocols and control is important,

1. bus steady control (handshake signals), most users select in the data before sending and receiving control-1ms to TC reset to high level, so that the bus into the stability of the send status before sending the data; the data sent to delay 1ms rear TC-end into a low level, allowing reliable send finished to receive status, according to the author to use TC-delay has four machine cycle was satisfy requirements; 2. to ensure data transmission quality, to validate each byte at the same time, minimize feature characters and verify Word, customary packet format by the boot code, length code, code, command, code, data, parity-check codes and code composition, each packet length up to 20 ~ 30 bytes, in RS-485 system such a protocol not too concise and recommend users use MODBUS Protocol, the Protocol has been widely used in water management, hydrology and electric power industries equipment and system of international standards,

4RS-485 interface circuit of power and grounding for the MCU with RS-485 micro system established and control network, should give priority to the use of the micro-system independent power supply scheme, it is best not to adopt a national power supply to the micro system parallel power supply, power cord (AC and DC) cannot be RS-485 signal lines sharing the same unit RS-485 multi-core cable, signal cable to choose section 0.75mm2 above twisted pair instead of a flat line, for each small capacity DC power use linear power supply LM7805 selection switch power than better, of course, it should be noted that the protection: LM7805

1.LM7805 input and to crossover 220 ~ 1000 μ F Electrolytic Capacitor;

2.LM7805 input and output side reverse 1N4007 diode;

3.LM7805 output and to crossover 470 ~ 1000 μ F electrolytic capacitor and 104pF monolithic capacitor and reverse 1N4007 diode;

4. input voltage to 8 ~ 10V is preferred, the maximum allowable range 6.5 ~ 24V, choose the alternative LM7805 PT5100 TI, to achieve 9 ~ 38V's super wide voltage input,

5 optical isolation

In some areas of industrial control, because the situation is very complex, each node is high common-mode voltage, while the RS-485 interface is differential transmission mode, with a certain degree of resistance to common mode interference capability, but when common-mode voltage exceeds the limit of RS-485 receiver receives the voltage, which is greater than + 12V or less than-7V, the receiver will no longer work, serious and even burnt chip and equipment,

Solving such problems by DC-DC the system power and RS-485 transceiver power isolation; through the optical coupling signal isolation, complete elimination of the effects of common-mode voltage, ways of implementing this programme can be divided into:

(1) using optical Coupler, with isolation of DC-DC, RS-485 chip architecture circuit;

(2) using a second integrated chip, such as PS1480, MAX1480 etc,

6RS-485 system common breakdown and solution RS-485 is a low-cost, easy communication system, but at the same time competing on the stability of weak and strong, usually have a node failure will cause the system to a total or partial paralysis, and it is difficult to judge, so the readers to explain some of the maintenance of commonly used methods, RS-485

1) If a system completely paralyzed, mostly because a node chip VA, VB on power breakdown, use multimeter VA and VB-differential mode voltage is zero, but on the ground of common-mode voltage greater than 3V, this time by measuring the size to troubleshoot common-mode voltage and common-mode voltage greater description from the point of failure, on the contrary, the farther away the closer;

2) bus for several nodes does not work, is normally provided by a node failure, a node failure will result in adjacent 2 ~ 3 node (typically a follow-up) cannot communicate, so will its individually and bus from, if a node cannot recover from the normal after bus, the node failure;

3) centralized supply of RS-485 system in power is often part of the node is not working properly, but each time was not exactly the same, this is due to the transceiver control end RS-485 TC design unreasonable, causing micro system power-on State of confusion when node transceiver causing bus plug, improved by the micro system with the power switch and power separately;

4) system basically normal but occasionally there is a communication failure, usually due to network construction unreasonable result in system reliability in a critical state, it is best to change the alignment or increase relay modules, one of the emergency method will appear to the failed node to replace into performance better chip;

5) MCU failure status TC-end in long hair and a bus, death, remind readers forget on TC-check, although RS-485 provides differential mode voltage greater than 200mV is functioning correctly, but the actual measurement: a well-functioning system of their differential mode voltage General around the 1.2V (for network distribution and rate difference may make differential mode voltage in range 0.8 ~ 1.5V).

No comments:

Post a Comment