RS-485 connections Protection circuit design and

1, RS-232/422/485 standard

It is typically integrated with a microprocessor or multiple hardware UART channels can easily serial communication. In industrial control, power communications, smart meters and other fields, often use easy to use serial communication as a means of data exchange.

However, in industrial control environments, electrical noise often have a transmission line, when using the RS-232 communication is often due to external electrical interference caused by signal transmission errors; Further, the maximum transmission distance of RS-232 communication without increasing the buffer in the case can be reached only 15 meters. In order to solve the above problem, RS-485/422 communication came into being.

RS-232, RS-422 and RS-485 are initially developed by the Electronic Industries Association (EIA) and published. RS-232 released in 1962, was named EIA-232-E, as an industry standard to ensure compatibility between products from different manufacturers. RS-422 RS-232 is evolved, which is to compensate for the lack of RS-232 proposed. RS-232 is to improve the communication distance is short, low rate disadvantage, RS-422 communication interface defines a balance, to increase the transmission rate to 10Mbps, the transmission distance is extended to 4,000 feet (when the rate is below 100kbps), and allows a up to 10 connected to the balanced bus receivers. RS-422 is a stand-alone transmission, receives the multi-way, balanced transmission standard, was named TIA / EIA-422-A standard. To extend the application range, EIA and developed in 1983 based on the RS-422 RS-485 standard, multi-point increases, bi-directional communication capability, which allows multiple transmitters connected to the same bus, while increasing the transmitter drive capability and conflict protection features, the expansion bus common mode range, named after the TIA / EIA-485-a standard. Since the EIA recommendations are based on the standard "RS" as a prefix, so in the communications industry, still used the above criteria to RS prefixed title.

RS-232, RS-422 and RS-485 standard only be made to a predetermined electrical characteristics of the interface, without involving connectors, cables or protocol, on the basis of the user can create their own level communication protocol. However, due to the serial data communication via the UART chip is PC (PC using older versions of I8250 Z8530 chip or chips) processed, the communication protocol also specifies the format of the serial data units (8-N-1 format) : start bit of logic 0, 6/7/8 data bits, 1 bit odd selectable (the oDD) / coupling (the eVEN) parity bit, 1/2 logic 1 stop bit. PC-based RS-232, RS-422 and RS-485 standard are used the same protocol.

      RS-232, RS-422, RS-485 distinction:

 

 

RS-485 and interface circuit design protection - Polaris - xiebingsuccess the blog

 1.1 RS-232 standard

 

RS-232 is defined as a low-rate, short-range single-ended serial communication standard. RS-232 take the unbalanced transmission mode, i.e., a so-called single-ended communication.

Electrical standard RS-232:

When the level is a logic "0": + 3V ~ + 15V;

Level is a logic "1": -3V ~ -15V;

Undefined area: -3V ~ + 3V. In this region the signal processing by the RS-232 communication interface transceivers determined.

1.2 RS-422/485 standard

RS-422/485 standards called the TIA / EIA-422-B and TIA / EIA-485 serial communication standard. RS-422/485 and RS-232 standard is not the same standard, the data signal is differential (Differential Driver Mode), also known as balanced transmission.

Since the RS-422/485 standards are similar in electrical properties, they differ in the transmission mode; for ease of understanding, the following describes the more common applications of the standard RS-485, RS-422 and introduces the standard RS-485 standard difference.

1.2.1 RS-485 standard

RS-485 is half-duplex, two-wire bidirectional transmission differential signal, having a multi-point, bi-directional communication capability, which allows multiple transmitters and receivers connected to the same bus, the transmission direction of the signal transmission line is variable. Thus, identification and control signal transmission direction is the key to good design of the transmission line RS-485 repeater.

  RS-485 standard: a data signal is differential (differential driver mode), also referred to as "the balanced transmission." It uses a twisted pair, in which a line is defined as A, the other wire is defined as B, as shown in FIG. RS-485 standard specifies only the electrical characteristics of balanced transmitter and receiver, but does not require connectors, cable transmission and application layer protocol.

 

RS-485 and interface circuit design protection - Polaris - xiebingsuccess the blog

                 FIG 1 RS-485 schematic transmitter

 

  Typically, RS485 transmitter A, B between the positive level + 2 ~ + 6 V, is a logic state; negative level -6 ~ -2 V, is another logic state. RS-485 transmission device, typically a "enable" control signals for controlling the connection and disconnection of the transmission line transmitter. When "enable" terminal is low, the transmitter output is in high impedance state, referred to as "third state." It is different from the logic "1" and "0" in the third state.

  For the RS-485 receiver and transmitter also made provisions opposing, closed, by originating the balanced twisted pair connected to the corresponding AA and BB. When at the receiving end A, B there between greater than +200 mV level, the output is positive logic level; less than -200 mV, the output of the negative logic levels. In the receiver receiving the balance line, the level range of usually 200 mV ~ 6 V, as shown in FIG.

 

RS-485 and interface circuit design protection - Polaris - xiebingsuccess the blog

                         FIG 2 RS-485 schematic diagram of the receiver

 

RS-485 receiver likewise define a logical 1 (positive logic level) of B> A is the state logic 0 (negative logic level) is the pressure difference between the A> B, the state, A, B is not less than 200 mV. In the RS-485 receiver device, generally a "enable" control signals for controlling the connection and disconnection of the transmission line receivers. When "enable" when the terminal is high, the receiver and transmitter wire cutting, the receiver output is high; and when "enable" terminal is low, the output of the receiver consistent with the logic level of the signal level of the bus.

    TIA EIA-485 serial communication standard performance /:

 

RS-485 and interface circuit design protection - Polaris - xiebingsuccess the blog

     RS-485标准的最大传输距离约为1219米,最大传输速率为10Mbps。通常,RS-485网络采用平衡双绞线作为传输媒体。平衡双绞线的长度与传输速率成反比,只有在20kbps速率以下,才可能使用规定最长的电缆长度。只有在很短的距离下才能获得最高速率传输。一般来说,15米长双绞线最大传输速率仅为1Mbps。注意:并不是所有的RS-485收发器都能够支持高达10Mbps的通讯速率。如果采用光电隔离方式,则通讯速率一般还会受到光电隔离器件响应速度的限制。RS-485网络采用直线拓朴结构,需要安装2个终端匹配电阻,其阻值要求等于传输电缆的特性阻抗(一般取值为120Ω)。在矩距离、或低波特率波数据传输时可不需终端匹配电阻,即一般在300米以下、19200bps不需终端匹配电阻。终端匹配电阻安装在RS-485传输网络的两个端点,并联连接在A-B引脚之间。

 

终端电阻是为了消除在通信电缆中的信号反射,在通信过程中,有两种原因导致信号反射:阻抗不连续和阻抗不匹配。阻抗不连续,信号在传输线末端突然遇到电缆阻抗很小甚至没有,信号在这个地方就会引起反射。这种信号反射的原理,与光从一种媒质进入另一种媒质要引起反射是相似的。消除这种反射的方法,就必须在电缆的末端跨接一个与电缆的特性阻抗同样大小的终端电阻,使电缆的阻抗连续。由于信号在电缆上的传输是双向的,因此,在通讯电缆的另一端可跨接一个同样大小的终端电阻。引起信号反射的另外一个原因是数据收发器与传输电缆之间的阻抗不匹配。这种原因引起的反射,主要表现在通讯线路处在空闲方式时,整个网络数据混乱。为了提高网络节点的拓扑能力,总线两端需要接有120Ω的抑制反射的终端电阻, 它对匹配总线阻抗起着非常重要的作用,如果忽略此电阻,会使数字通信的抗干扰性和可靠性大大降低,甚至无法通信。

        RS-485标准通常被用作为一种相对经济、具有相当高噪声抑制、相对高的传输速率、传输距离远、宽共模范围的通信平台。同时,RS-485电路具有控制方便、成本低廉等优点。在过去的20年时间里,建议性标准RS-485作为一种多点差分数据传输的电气规范,被应用在许多不同的领域,作为数据传输链路。目前,在我国应用的现场网络中,RS-485半双工异步通信总线也是被各个研发机构广泛使用的数据通信总线。但是基于在RS-485总线上任一时刻只能存在一个主机的特点,它往往应用在集中控制枢纽与分散控制单元之间。

2、RS485芯片

 

RS-485 and interface circuit design protection - Polaris - xiebingsuccess the blog

 RS-485 and interface circuit design protection - Polaris - xiebingsuccess the blog

 

 功能分析:

1.描述

SP481E和SP485E是半双工差分收发器,完全满足RS-485和RS-422的要求。它们由Sipex特有的BiCMOS工艺制造而成。RS-485标准理想地用于多分支(multi-drop)应用和远程接口中。它允许在一条数据线上连接32个发送器和接收器,非常适合于多分支应用。由于允许使用4000英尺长的电缆,RS-485收发器可以使用一个宽(-7V~+12V)共模方式范围来调整零电位偏差。因为RS-485是一个差分接口,所以传输数据时完全可以抑制来自发送线的干扰。

    2.发送器

        SP481E和SP485E的输出是差分输出,满足RS-485和RS-422标准。空载时输出电压的范围为0V~+5V。即使在差分输出连接了54?负载的条件下,发送器仍可保证输出电压大于1.5V。SP481E和SP485E有一根使能控制线(高电平有效)。DE(Pin3)上的逻辑高电平将使能发送器的差分输出。如果DE(Pin3)为低,则发送器输出呈现三态。SP481E和SP485E发送器的数据传输速率至少为10Mbps。

    3.接收器

        SP481E和SP485E接收器的输入是差分输入,输入灵敏度可低至±200mV。接收器的输入电阻通常为15k?(最小为12k?)。-7V~+12V的宽共模方式范围允许系统之间大的零电位偏差的存在。SP481E和SP485E的接收器有一个三态使能脚。如果RE(Pin2)为低,接收器使能,反之接收器禁止。SP481E和SP485E接收器的数据传输速率至少为10Mbps。两者的接收器都有故障自动保护(fail-safe)特性,该特性可以使得输出在输入悬空时为高电平状态。

    4.关断模式

        SP481E可以工作在关断模式。关断状态通过同时禁能发送器和接收器来使能。当DE (Pin3)为低且RE(Pin2)为高时SP481E进入关断模式。关断模式下,电源电流降至1uA。

 

3、RS-485接口电路

    RS-485接口电路的主要功能是:将来自微处理器的发送信号TX通过“发送器”转换成通讯网络中的差分信号,也可以将通讯网络中的差分信号通过“接收器”转换成被微处理器接收的RX信号。任一时刻,RS-485收发器只能够工作在“接收”或“发送”两种模式之一,因此,必须为RS-485接口电路增加一个收/发逻辑控制电路。另外,由于应用环境的各不相同,RS-485接口电路的附加保护措施也是必须重点考虑的环节。下面以选用SP485R芯片为例,列出RS-485接口电路中的几种常见电路,并加以说明。

3.1基本RS-485电路

 

 

RS-485 and interface circuit design protection - Polaris - xiebingsuccess the blog

                              1-19 SP485R的基本RS-485电路

 

图1-19为一个经常被应用到的SP485R芯片的示范电路,可以被直接嵌入实际的RS-485应用电路中。由微处理器输出的R/D信号直接控制SP485R芯片的发送器/接收器使能:R/D信号为“1”,则SP485R芯片的发送器有效,接收器禁止,此时微处理器可以向RS-485总线发送数据字节;R/D信号为“0”,则SP485R芯片的发送器禁止,接收器有效,此时微处理器可以接收来自RS-485总线的数据字节。此电路中,任一时刻SP485R芯片中的“接收器”和“发送器”只能够有1个处于工作状态。连接至A引脚的上拉电阻R7、连接至B引脚的下拉电阻R8用于保证总线空闲时,A/B差分信号仍是确定状态,避免杂讯影响。

      电路图中,钳位于6.8V的TVS管V4、V5、V6都是用来保护RS-485总线的,避免RS-485总线在受外界干扰时(雷击、浪涌)产生的高压损坏RS-485收发器。另外,电路中的L1、L2、C1、C2是可选安装元件,用于提高电路的EMI性能。

3.2隔离RS-485电路

 

RS-485 and interface circuit design protection - Polaris - xiebingsuccess the blog

                                                        1-20 SP485R的隔离RS-485电路

 

图1-20为一个使用光电隔离方式连接的SP485R芯片的示范电路,可以被直接嵌入实际的RS-485应用电路中。微处理器的UART串口的RXD、TXD通过光电隔离电路连接SP485R芯片的RO、DI引脚,控制信号R/D同样经光电隔离电路去控制SP485R芯片的DE和/RE引脚。由微处理器输出的R/D信号通过光电隔离器件控制SP485R芯片的发送器/接收器使能:R/D信号为“1”,则SP485R芯片的DE和/RE 引脚为“1”,发送器有效,接收器禁止,此时微处理器可以向RS-485总线发送数据字节;R/D信号为“0”,则SP485R芯片的DE和/RE引脚为“0”,发送器禁止,接收器有效,此时微处理器可以接收来自RS-485总线的数据字节。任一时刻,SP485R芯片中的“接收器”和“发送器”只能够有1个处于工作状态。

连接至A引脚的上拉电阻R7、连接至B引脚的下拉电阻R8用于保证无连接的SP485R芯片处于空闲状态,提供网络失效保护,以提高RS-485节点与网络的可靠性。使用DC-DC器件可以产生1组与微处理器电路完全隔离的电源输出,用于向RS-485收发器电路提供+5V电源。电路中光耦器件的速率将会影响RS-485电路的通讯速率。图1-20中选用了NEC公司的光耦器件PS2501芯片,受PS2501芯片的响应速率影响,这一示范RS-485接口电路的通讯速率只可保障在19200bps速率下正常工作;如果需要达到更高的RS-485通讯速率,则需要选用响应速度更快的光耦器件,比如Agilent公司的超高速光耦元件。


3.5 一个实际产品中的RS485接口电路

 

RS-485 and interface circuit design protection - Polaris - xiebingsuccess the blog

4、RS485总线输出电路部分的设计

Output circuit designed to fully take into account the characteristic impedance of the line matching and interference on the line. As the project environment is complex, often-site sources of interference in all its forms, the transmission end 485 must be added protective measures. D301 regulator employed in the circuit design, the snubber circuit consisting of D302, may be able to choose an anti-surge transient clutter suppression TVS device or can direct selection of anti-lightning chip 485 (e.g. SN75LBC184 etc.).

Considering the special case where the line (such as a table extension 485 chip short-circuit breakdown are) affected to prevent the communication of another extension bus, the signal output terminal MAX487EESA series resistance of 200Ω two R314, R315. Such hardware failure of the machine will not be affected entire bus communication.

In the on-site construction system engineering, since the communication medium is twisted pair, its characteristic impedance is about the 120-ohm, so that circuit design, at the beginning and end of the RS-485 network transmission lines each to be connected to a the 120-ohm matching resistor ( this is optional, see the foregoing description), to reduce reflection of the transmission signal on the line.

    Since the characteristics of RS-485 chip, the detection sensitivity of the receiver is ± 200mV, i.e. differential input VA-VB ≥ + 200mV, the output logic 1, VA-VB ≤-200mV, output logic 0; and A, B terminal potential difference when the absolute value is less than 200mV, the output is undefined. If all transmitters are disabled on the bus, the receiver outputs a logic 0, which may be mistaken for the start of a communication frame due to not working properly. The solution to this problem is to artificially A potential side potential is higher than the ends B, (when the bus is suspended) exhibits a high level only during such a level does not transmit the RXD 485, the microcontroller would not be mistaken interruption receive a random character. By circuit A 485, B added to the output pull-down resistors R313, R312, can solve this problem. 

Guess you like

Origin blog.csdn.net/xiebingsuccess/article/details/91876680