文档视界 最新最全的文档下载
当前位置:文档视界 › RS485电路设计

RS485电路设计

RS485电路设计
RS485电路设计

Designing

RS-485 Circuits

Jan Axelson

RS-485 is often the interface of choice.The network nodes can be PCs,microcontrollers, or any devices capable of asynchronous serial https://www.docsj.com/doc/da4642940.html,pared to Ethernet and other net-work interfaces, RS-485’s hardware and protocol requirements are simpler and cheaper.

The RS-485 standard is flexible enough to provide a choice of drivers,receivers, and other components de-pending on the cable length, data rate,number of nodes, and the need to conserve power.

Several vendors offer RS-485 trans-ceivers with various combinations of features. Also, there are options for methods of terminating and biasing the line and controlling the driver-enable inputs.

In this article, I show you several circuits for RS-485 networks. Even if

you use prebuilt cards or converters,understanding the options will help you choose the right product and

configure it to get the best results for your application.

RS-485 IN BRIEF

But first, a quick look at RS-485.The interface popularly known as RS-485 is an electrical specification for multipoint systems that use balanced lines. RS-485 is similar to RS-422, but RS-422 allows just one driver with multiple receivers whereas RS-485supports multiple drivers and receivers.The specification document (TIA/EIA-485-A) defines the electrical char-acteristics of the line and its drivers and receivers. There are brief sugges-tions relating to terminations and wiring, but there’s no discussion of connector pinouts or software proto-cols (as there is for RS-232).

An RS-485 network can have up to 32 unit loads, with one unit load equiva-lent to an input impedance of 12k. By using high-impedance receivers, you can have as many as 256 nodes.

An RS-485 link can extend as far as 4000′ and can transfer data at up to 10 Mbps, but not both at the same time. At 90 kbps, the maximum cable length is 4000′, at 1 Mbps it drops to 400′, and at 10 Mbps it drops to 50′.For more nodes or long distances, you can use repeaters that regenerate the signals and begin a new RS-485 line.Although the RS-485 standard says nothing about protocols, most RS-485links use the familiar asynchronous protocols supported by the UARTs in PCs and other computers. A transmitted word consists of a start bit followed by data bits, an optional parity bit, and a stop bit.

Two ways to add RS-485 to a PC are on an expansion card and by at-taching an RS-485 converter to an existing port. Converters for RS-232are widely available and Inside Out Networks has developed a USB–to–RS-485 converter, also available from B&B Electronics. On microcontrollers,you can connect an RS-485 transceiver

to any asynchronous serial port.Many network circuits also require a port bit to control each transceiver’s driver-enable input.Ports designed for RS-232 com-munications can use the RTS output. If that’s not available, any spare output bit will do.

Most serial-communications tools, including Visual Basic’s MSComm, support RS-485 com-munications with RTS controlled in software. The COMM-DRV serial-port drivers from WCSC have auto-matic RTS control built-in.

The main reason why RS-485 links can extend so far is their use of bal-anced, or differential, signals. Two wires (usually a twisted pair) carry the signal voltage and its inverse. The receiver detects the difference be-tween the two. Because most noise that couples into the wires is com-mon to both wires, it cancels out.In contrast, interfaces like RS-232use unbalanced, or single-ended, signals.The receiver detects the voltage differ-ence between a signal voltage and a common ground.

The ground wire tends to be noisy because it carries the return currents for all of the signals in the interface,along with whatever other noise has entered the wire from other sources.And noise on the ground wire can cause the receiver to misread transmitted logic levels.

The datasheets for interface chips label the noninverted RS-485 line as line A and the inverted line as line B.An RS-485 receiver must see a voltage difference of just 200 mV between A and B. If A is at least 200 mV greater than B, the receiver’s output is a logic high. If B is at least 200 mV greater than A, the output is a logic low. For differ-ences less than 200 mV, the output is

undefined.

At the driver, the voltage difference must be at least 1.5 V, so the interface tolerates a fair amount of non-common-mode noise and attenuation.

Vendors for RS-485 transceivers include Linear Technology, Maxim,National Semiconductor, and Texas Instruments. These companies are also excellent sources for application notes containing circuit examples and explanations of the theory behind them.RS-485 is designed to be wired in a daisy-chain or bus topology. Any stubs that connect a node to the line should be as short as possible. Most links use twisted pairs because of their ability to cancel magnetically and electro-magnetically coupled noise.

GENERAL-PURPOSE LINK

Figure 1 shows a general-purpose RS-485 network. Each node has a Texas Instruments SN75176B transceiver that interfaces between RS-485 and TTL logic levels.

The chip has a two-wire RS-485interface, a TTL driver input and re-ceiver output, and TTL enable inputs for the driver and receiver. Similar chips include Linear Technology’s LTC485, Maxim’s MAX485, and Na-tional Semiconductor’s DS3695.The circuit has two 120-? termi-nating resistors connected in parallel,at or just beyond the final node at each

end of the link. One end of the link also has two 560-? biasing resistors.The terminations reduce voltage reflections that can cause the receiver to misread logic levels. The receiver sees reflected voltages as output switches,and the line settles from its initial current to its final current. The termi-nation eliminates reflections by making the initial and final currents equal.The initial current is a function of the line’s characteristic impedance,which is the input impedance of an infinite open line. The value varies with the wires’ diameters, the spacing between them, and the insulation type.For digital signals (which consist mainly of frequencies greater than 100 kHz), the characteristic impedance is mostly resistive; the inductive and capacitive components are small. A typical value for 24-AWG twisted pair is 120 ?.

The final current is a function of the line termination, the receivers’input impedance, and the line’s series impedance. In a typical RS-485 line without a termination, the initial cur-rent is greater than the final current because the characteristic impedance is less than the receivers’ combined input impedance.

On a line without a termination,the first reflection occurs when the initial current reaches the receiver.The receiver’s input can absorb only a fraction of the current. The rest re-flects back to the driver. As the cur-rent reverses direction, its magnetic field collapses and induces a voltage on the line. As a result, the receiver initially sees a greater voltage than what was transmitted.

When the reflected voltage reaches the driver, which has a lower imped-ance than the line, the driver absorbs some of the reflection and bounces the rest back to the receiver. This

reflection is of opposite polarity to the first reflection and causes the receiver to see a reduced voltage. The reflections bounce back and forth like this for a few rounds before they die out and the line settles to its final current.

If the line terminates with a resistor equal to the line’s characteristic im-pedance, there are no reflections. When

the initial current reaches the termi-

Figure 1—This general-purpose RS-485network can have up to 32 nodes. Biasing

resistors ensure that there are no false start bits when no drivers are enabled.

be isolated from earth ground.

The ground wire provides a

path for the current that results

from small imbalances in the

balanced line. If the A and B

outputs balance exactly with

equal, opposite currents, the two

currents in the ground wire can-cel each other out and the wire

carries no current at all. In real

life, components don’t balance

perfectly; one driver will be a little stronger and one receiver

will have a slightly larger input

impedance.Without a common ground, the circuit may work, but the energy from the imbalance has to go somewhere and may dissipate as electromagnetic radiation.The RS-485 specification recom-mends connecting a 100-? resistor of at least 0.5 W in series between each node’s signal ground and the network’s ground wire, as Figure 1 shows. This way, if the ground potentials of two nodes vary, the resistors limit the current in the ground wire.SIMPLIFIED LOW-POWER LINK Adding terminations increases a link’s power consumption. With two parallel 120-? terminations and a dif-ferential output of 1.5 V, the current through the combined terminations is 25 mA (disregarding the effects of bias-ing, attenuation, etc.).Without terminations, the load is the parallel combination of the receiv-ers’ input impedances and varies with the number of receivers. The maximum 32-unit loads have a combined parallel impedance of 375 ? to ground or V+.For some shorter and slower links,you can save power and components by not using terminating and biasing components. This option is feasible if the line is electrically short, which means it behaves as a lumped,rather than distributed,system. On a short line,

the reflections die out long before the receiver is ready to read the signal.A general guideline is that a line is short if the rise time of its signals is greater than four times the signals’ one-way delay. The one-way delay is the amount of time needed for a signal to travel from the driver to the receiver.It’s a function of the line’s physical length and the speed of signals in the line. In copper wire, a typical speed is two-thirds the speed of light, which works out to 8 in./ns. Cable manufac-turers often specify a value for prod-ucts likely to be used in network wiring.The rise time is specified in the driver’s datasheet. The slowest chip I’ve found is Maxim’s MAX3080, with a minimum rise time of 667 ns. With cables of up to 100″, the rise time is greater than four times the one-way delay (4 × 150 ns), so the line behaves as a short line and doesn’t need termi-nating or biasing. Another advantage is that the internal biasing pulls idle lines to nearly V+ and ground, so you get greater noise immunity.The downside to using this chip is that the slow rise time means that it’s rated for use only at 115,200 bps or less.SHORT-CIRCUIT PROTECTION The previous circuits ensured that the line was in a predictable state when idle or open. The circuit in Figure 2also protects the network as much as possible if the signal lines are shorted.Instead of a single pair of biasing re-sistors for the entire line, the circuit has four biasing resistors at each node.The circuit uses Texas Instruments 75ALS180B transceivers, which have full-duplex RS-485 inputs and outputs.The separate transmit and receive pairs enable the receiver to have its own series biasing resistors. The two RS-485lines connect just beyond the biasing circuits.If the signal lines short together,the 1.8-k ?

series resistors in combina-Figure 3—A galvanically isolated link has no ohmic connection to earth

ground or to the other circuits the network connects to.Figure 2—The biasing resistors in this network hold the

receiver’s inputs in an idle state when no drivers are enabled, or if the node disconnects from the network, or if the signal lines

are shorted.nation, it sees exactly what it was

expecting—a load equal to the line’s

characteristic impedance. The entire

transmitted voltage drops across the

load. In a network with two parallel

terminations, the drivers drive two

lines with each ending at a termination.

The biasing resistors hold the line

in a known state when no drivers are

enabled. Most RS-485 transceivers

have internal biasing circuits, but add-ing a termination defeats their ability

to bias the line. A typical internal cir-cuit is a 100-k ? pullup from line A to

V+, and a 100-k ? pulldown from line B to ground.With no termination and when no drivers are enabled, the biasing resistors hold line A more positive than line B.When you add two 120-? terminations,the difference between A and B shrinks to a few millivolts, much less than the required 200 mV. The solution is to add smaller resistors in parallel with the internal biasing so that a greater proportion of the series voltage drops across the termination.The size of the biasing resistors is a tradeoff. For a greater voltage difference and higher noise immunity on an idle line, use smaller values. For lower power consumption and a greater differential voltage on a driven line,use larger values.When the receiver is disabled, the receiver’s output is high impedance. If the output doesn’t connect to a input with an internal pullup, adding a pull-up here ensures that the node doesn’t see false start bits when its receiver is disabled.To comply with the specification,all of the nodes must share a common ground connection. This ground may

tion with the 36-k? biasing resistors hold input A more positive than B. Of course, the node can’t communicate with the network if the line is open or shorted, but at least it remains in an idle state (with no false start bits) until the problem is fixed.

Another way to accomplish the same thing is to use transceivers with built-in fail-safe protection for open

and short circuits. Chips that have this feature take varying approaches.

Linear Technologies’ LTC1482 has a carrier-detect function that brings the receiver’s output high when the differ-ential input voltage is too small to be a valid logic level. The chip has a carrier-detect output that indicates when the line is in an invalid state. National Semiconductor’s DS36276 has internal circuits that bring the receiver’s out-put high if the line is shorted or open.

Maxim’s MAX3080–89 series provide short-circuit biasing by redefining the threshold for logic 0. Instead of specify-ing all differential inputs of less than 200 mV as undefined, these chips define a differential voltage of –50 mV or greater as a logic 0.

Voltages equal to or more negative than –200 mV remain defined as logic 1s. The only undefined region is from –50 to –200 mV. With these definitions, a shorted line (which results in a differ-ential input of 0 V) is a logic 0, which results in a high output at the receiver. ISOLATED LINK

The entire RS-485 network has to share a ground, but the network can be galvanically isolated from other circuits the network connects to as well as from earth ground.

All RS-485 components must be able to operate with common-mode voltages between –7 V and +12 V. Some compo-nents have higher ratings. The common-mode voltage at the receiver equals half the sum of the two signal voltages, refer-enced to the receiver’s signal ground. The voltage varies with the differen-tial signal voltages, the difference in ground potentials between the driver and receiver, and noise on the line.

Where the ground connection is long, isolating the ground can ensure that the components don’t exceed their ratings. Isolation also protects the cir-cuits the network connects to if

the network circuits are damaged

by high voltage.

Complete isolation requires

isolating the power supplies and the

network’s signals. The power supplies

typically use transformer isolation,

whereas the signals use optoisolators

(see Figure 3).

A one-chip way to achieve isolation

is to use Maxim’s MAX1480, which

contains its own transformer-isolated

supply and optoisolated signal path.

AUTO-SWITCHING LINK

One of challenges in designing an

RS-485 link is controlling the driver-

enable lines. Because all of the nodes

share a data path, only one driver can

be enabled at a time. Before transmit-

ting, a driver must be sure that the

previous driver has been disabled.

Many RS-485 networks use a com-

mand/response protocol; one node

sends commands and the node being

addressed returns a response. The UART

in the node being addressed detects

the final stop bit in the middle of the

bit width, or slightly sooner or later if

the sender’s clock doesn’t match exactly.

A very fast node may be ready to

send a reply within a few microseconds

after detecting the stop bit. To prevent

the need for a delay before responding,

the sending node’s driver should be

disabled as soon as possible after the

leading edge of its final stop bit.

In most systems, the transmitting

driver is enabled on the leading edge

of the start bit and remains enabled for

the entire transmission. It is disabled as

soon as possible after the final stop bit.

In the delays between transmissions,

biasing holds the line in an idle state.

There are various ways that the

transmitting node can determine when

a transmission has finished and it is

safe to disable the driver. The node

may read back what it sent, or it may

use a hardware or software timer to

estimate the time needed to transmit.

Figure 4 shows a completely auto-

matic way to control the enable line so

the driver is disabled as quickly as

possible, soon after the leading edge of

the stop bit. With this circuit, the

program code doesn’t have to toggle a

signal to enable and disable the driver,

and a transmitting driver doesn’t need

to allow extra time to be sure that the

previous driver has been disabled.

Unlike other methods of automatic

control, there are no jumpers to set for

a particular bit rate. I learned of this

method when I saw it in R.E. Smith’s

IRSFC24 Isolated RS-485 board.

Instead of keeping the transmitter

enabled for the entire transmission,

the circuit in Figure 4 enables the driver

on the leading edge of the start bit or

any logic low at the driver’s input. It

also disables the driver ~40 μs after the

leading edge of the stop bit or any logic

high at the driver’s input. When the

driver is disabled, biasing resistors en-

sure the receiver’s output is a logic high.

The delay is generated by a 555 timer

configured as a monostable (one shot).

The enable inputs of the driver and

receiver are tied together so the receiver

is disabled when the driver transmits.

The timer’s output controls the

transceiver’s enable inputs. A falling

edge at Data Out indicates a start bit

and triggers the timer. The timer’s

output goes high, enabling the driver

and bringing line B more positive than

line A. Diode feedback to the Trig

input holds the timer’s output high

for as long as Trig remains low.

When Data Out goes high, the RS-

485 line switches, bringing line A more

positive than line B. The same logic Figure 4—This circuit’s automatic driver-enable

ensures that the previous driver is disabled by the

time the next node begins to transmit. The driver-

enable line follows the data with a short delay

before disabling the driver. Biasing circuits hold

the line in the correct state when the driver is

disabled.

high also causes the timer to begin timing out. About 40 μs after the rising edge, the timer’s output goes low, dis-abling the driver.

The delay ensures that the driver’s RS-485 output switches without delay,while the driver is enabled. When the driver is disabled, the biasing compo-nents continue to hold A more posi-tive than B.

Similarly, any falling edges in the transmitted data enable the driver and any rising edges disable the driver after the delay. On the final stop bit, the driver is disabled no later than 40 μs after the stop bit’s leading edge.

At rates of 9600 bps or less, the bit width is greater than 100 μs, which means the driver is disabled at around the middle of the bit width. At faster bit rates, the driver will still be disabled no more than 40 μs after the stop bit’s leading edge. For networks needing very fast response time at faster bit rates,decrease R4 for a shorter delay.

A downside is that the final voltage for logic zeros is the biasing voltage,which is usually less than the differen-tial voltage when the driver is enabled.But because the biasing voltage needs to be great enough to prevent errors from noise on an idle line, it should do the job for active logic states as well.

I RS-485 transceivers Linear Technology (408) 432-1900

Fax: (408) https://www.docsj.com/doc/da4642940.html, Maxim Integrated Products

(408) 737-7600J. Axelson, Serial Port Complete:Programming and Circuits for RS-232 and RS-485 Links and Networks , Lakeview Research,Madison, WI, 1998.

Jan Axelson has been involved with computers and electronics for over 20years. Her books include Serial Port Complete , Parallel Port Complete ,and The Microcontroller Idea Book .You may reach her at jan@https://www.docsj.com/doc/da4642940.html, or on the web at https://www.docsj.com/doc/da4642940.html,.

Fax: (408) https://www.docsj.com/doc/da4642940.html, National Semiconductor (800) 272-9959(408) 721-5000

Fax: (408) https://www.docsj.com/doc/da4642940.html,

Texas Instruments, Inc.(800) 477-8924, x4500(972) 995-2011

Fax: (972) https://www.docsj.com/doc/da4642940.html, TIA/EIA-485-A

Global Engineering Documents (800) 854-7179(303) 397-7956

Fax: (303) 397-2740

https://www.docsj.com/doc/da4642940.html,/sitemap.html USB–to–RS-485 converter Inside Out Networks (512) 301-7080

Fax: (512) https://www.docsj.com/doc/da4642940.html,

B&B Electronics Manufacturing Co.(815) 433-5100

Fax: (815) https://www.docsj.com/doc/da4642940.html,

COMM-DRV serial-port drivers (with RS-485 support)WCSC

(800) 966-4832(281) 360-4232

Fax: (281) https://www.docsj.com/doc/da4642940.html,

RS-485 interface with automatic enable control R.E. Smith (513) 874-4796

Fax: (513) https://www.docsj.com/doc/da4642940.html,

?Circuit Cellar INK, the Computer Applications Journal.Reprinted by permission. For subscription information,call (860) 875-2199 or subscribe ?https://www.docsj.com/doc/da4642940.html,

什么是RS485通信接口

什么是RS485通信接口 通信概述 通信设备从早期的邮件,电报,电话,传真,传呼机,手机,电脑,一路发展下来,而且随着科技的发展,世界必将由一个网络组成,所以,在未来开发的设备中,也必然要求大部分的设备都带有通信的功能。 设备与设备之间互相通信,就要有一座桥梁把二者连接起来,那就是传输通路与通信协议。传输通路由传输介质与传输接口组成,传输介质可分为有线和无线传输介质两大类。 有线传输介质在数据传输中只作为传输介质,而非信号载体。计算机网络中流行使用的有线传输介质为:铜线和玻璃纤维。 铜线具有便宜,安装容易的特点,在现在工业应用中普遍应用,在应用中主要有两种基本的铜线类型:双绞线和同轴电缆。双绞线可减小流过电流所辐射的能量,也可防止来自其他通信线路上信号的干扰,对于一些要求比较高的项目上,还需要给双绞线加上屏蔽层;同轴电缆由一对同轴导线组成。同轴电缆频带宽,损耗小,具有比双绞线更强的抗干扰能力和更好的传输性能。按阻抗值不同,同轴电缆可分为基带和宽带两种,同轴电缆是目前局域网与有线电视网中普遍采用的比较理想的传输介质。 所谓玻璃纤维介质,就是指现在所流行的光纤传输,他的两边有一个激光发生器与一个激光接收器,组成一整套通信线路,由于光纤传输距离远,因此现很多在工程都是采用“光端机+光纤”的模式。 结合我在工程中经常应用的通信模式,与“南方的老树51CPLD开发板”上具有的RS232通信、RS485通信两种,详细讲解下这两种通信方式的应用。 什么是RS232接口 首先介绍下什么是RS232接口,什么是RS485接口。

RS232接口是1970年由美国电子工业协会(EIA)联合贝尔系统、调制解调器厂家及计算机终端生产厂家共同制定的用于串行通讯的标准。它的全名是“数据终端设备(DTE)和数据通讯设备(DCE)之间串行二进制数据交换接口技术标准”该标准规定采用一个25个脚的DB25连接器,对连接器的每个引脚的信号内容加以规定,还对各种信号的电平加以规定。DB25的串口一般只用到的管脚只有2(RXD)、3(TXD)、7(GND)这三个,随着设备的不断改进,现在DB25针很少看到了,代替他的是DB9的接口,DB9所用到的管脚比DB25有所变化,是2(RXD)、3(TXD)、5(GND)这三个。因此现在都把RS232接口叫做DB9。 元器件常识:市场上把公头的接插件叫做DRXX,母头的叫DBXX,比如我们电脑上的串口,在市场上叫做DR9,不是DB9,很多人都误叫做DB9,实际上的DB9是两个把两个DR9互相连接在一起的接口。 在文章中,我把所有的串口设备接口都统一叫做RS232接口。 三、什么是RS485接口 由于RS232接口标准出现较早,难免有不足之处,主要有以下四点: (1)接口的信号电平值较高,易损坏接口电路的芯片,又因为与TTL 电平不兼容故需使用电平转换电路方能与TTL电路连接。 (2)传输速率较低,在异步传输时,波特率为20Kbps;因此在“南方的老树51CPLD开发板”中,综合程序波特率只能采用19200,也是这个原因。 (3)接口使用一根信号线和一根信号返回线而构成共地的传输形式,这种共地传输容易产生共模干扰,所以抗噪声干扰性弱。 (4)传输距离有限,最大传输距离标准值为50英尺,实际上也只能用在50米左右。 针对RS232接口的不足,于是就不断出现了一些新的接口标准,RS-485就是其中之一,它具有以下特点:

RS-232C、RS-422、RS-485串口引脚定义

RS-232C、RS-422、RS-485串口引脚定义 从前面的内容中,知道了串口外形,就可以继续了解其每个引脚的定义,这是做线的基础。无论是RS-232C、RS-422,还是RS-485,串口接口的外形、尺寸都是相同的,部件间可以通用互换,但其引脚的定义却各不相同,因此要了解串口做线,首先要知道串口各引脚的定义。 观察一个标准的串口,会发现串口无论是9针的标准串口物理外形(如图3.4所示),还是25针串口物理外形(如图3.6所示),如果横着看,都显示两排引脚。除了两排引脚这一特征之外,还有就是无论是公头,还是母头,两个引脚的外围呈现一边大、一边小的“等腰梯形”的形状(俗称“D形”)。9针引脚中,大的一边有5个引脚,小的一边有4个引脚。 本章除非专门说明,否则所有引脚线序都是指串口外侧的线序,各引脚编号及意义如图3.40所示。 根据图3.40的引脚顺序号,如果是作为RS-232C接口,则各引脚定义如表3.2所示。 表3.2 RS-232C引脚意义表 各引脚的电气特性为: 在TxD和RxD上,逻辑“1”为-3V~-15V;逻辑“0”为+3V~+15V。 在RTS、CTS、DSR、DTR和DCD等控制线上,信号有效为+3V~+15V;信号无效为-3V~-15V。 对于数据信号,逻辑“1”为低于-3V,逻辑“0”为高于+3V;对于控制信号,接通ON为低于-3V;断开OFF为高于+3V;-3V~+3V、低于-15V、高于+15V都表示电压无意义。 作为RS-232C接口,其各引脚由标准文档进行定义,所以也可以称为“标准引脚定义”。而作为RS-422和RS-485接口,则没有“标准”引脚定义的说法,因为RS-422和RS-485连通常的标准接口也没有,具体采用什么接口,接口中使用哪些引脚,完全取决于设备设计生产商自己的定义。不过,作为RS-422和RS-485标准本身,定义了按照这两个标准进行通信时,所必须提供的信号线,

RS485输出接口的温度传感器 (1)

RS232/RS485接口温度计串口温度计 一、产品简介: 采用数字传感器作为敏感元件,先进的单片机整机控制,精度高、稳定性好。轻巧、紧凑、精美的设计构造。广泛应用于温度监测与调节,工业环境控制,粮食仓储、烟草企业、医药、图书馆、微机房、通讯基站及实验室等需要环境温度监控的场所。提供简易通讯协议或标准MODBUS协议,便于二次开发,特别适合OEM配套。 二、型号:FY-W01 三、技术参数: 接口方式RS232 、RS485 分辨率0.1℃ 精度±0.2℃ 工作温度-40~+80℃ 有效测量范围-55.0~+125.0℃ 通讯协议提供 监测软件提供 数据采集器尺寸60(长)×35(宽)×25(高)mm 探头规格Φ6 50/60mm长 传感器电缆长度标配3米,可选最长10米 通讯电缆长度DB9孔式接口或5线,标配2米4线,标配2米 供电USB接口供电,供电电压5V--5.5V 供电电压5V--12V 四、简易版通讯协议:(标准MODBUS协议可来电询取) 通讯参数为::波特率固定9600bps,8位数据,1位停止位,无校验。(9600,N,8,1) ①PC->温度计类型地址询问 温度计->PC 类型地址应答 ②PC->温度计类型地址上传数据 温度计->PC 类型地址温度符号温度整数温度小数以上数据均为单字节 类型:温度计A8H 地址:固定地址(01H) 命令:询问CCH 应答33H 上传数据AAH 数据:BCD码格式,温度符号正00H 负80H 例23.4℃上传数据00H 23H 04H 应答周期500ms 即500ms无应答为通讯故障等错误 ============================================================= ============ 例:温度计地址01H ①询问与应答 PC->温度计A8H 01H CCH 温度计->PC A8H 01H 33H ②上传数据

串口RS232__485的9针引脚定义

RS485接口定义 rs485有两种,一种是半双工模式,只有DATA+和DATA-两线,另一种是全双工模式,有四线传输信号:T+,T-,R+,R-。全双工模式时可认为是rs422。 1.英式标识为TDA(-) 、TDB(+) 、RDA(-)、RDB(+) 、GND 2.美式标识为Y 、Z 、 A 、 B 、GND 3.中式标识为TXD(+)/A 、TXD(-)/B 、RXD(-) 、RXD(+)、GND rs485两线一般定义为(只接收不发送): "A, B"或"Date+,Date-" 即常说的:”485+,485-” rs485四线一般定义为: "Y,Z,A, B," 具体还要根据厂家的使用信号针脚而定,有的使用了RTS或DTR 等针脚的485信号 DB9(RS485)接口针脚定义 1脚为数据A,2脚为数据B,5脚为地。

RS-422的电气性能与RS-485完全一样。主要的区别在于: RS-422有4根信号线:两根发送(Y、Z)、两根接收(A、B)。由于RS-422的收与发是分开的,所以可以同时收和发(全双工)。RS-485有2根信号线:发送和接收都是A和B。 由于RS-485的收与发是共用两根线所以不能够同时收和发(半双工)。 * 能否将RS-422的Y-A短接作为RS-485的A,将RS-422的Z-B短

接作为RS-485的B呢? 回答:不一定。条件是RS-422必须是能够支持多机通信的。波士电子的所有接口转换器的RS-422口都能够支持全双工多机通信,所以可以这样简单转换为RS-485。 RS-485(或 RS-422)通信建议一定要接地线,因为 RS-485(或 RS-422)通信要求通信双方的地电位差小于 1V。即:半双工通信接 3 根线(+A、—B、地),全双工通信接 5 根线(+发、—发、+收、—收、地)。为了安全起见,建议通信机器的外壳接大地。 接线及引脚分配 RS-485的+A接对方的+A、—B接对方的—B、GND(地)接对方的 GND(地)。 RS-422 的接线原则:“+发”接对方的“+收”、“—发”接对方的“—收”、“+收”接对方的“+ 发”、“—收”接对方的“—发”、GND(地)接对方的 GND(地)。 一定要将GND(地)线接到对方的GND(地),除非确保通信双方都已经良好共地。

RS485总线接口引脚定义及说明

RS485总线标准是工业中(考勤,监控,数据采集系统)使用非常广泛的双向、平衡传输标准接口,支持多点连接,允许创建多达32个节点的网络;最大传输距离1200m,支持1200 m时为100kb/s的高速度传输,抗干扰能力很强,布线仅有两根线很简单。 RS485通信网络接口是一种总线式的结构,上位机(以个人电脑为例)和下位机(以51系列单片机为例)都挂在通信总线上,RS485物理层的通信协议由RS485标准和51单片机的多机通讯方式。由于RS-485是从RS-422基础上发展而来的,所以RS-485许多电气规定与RS-422相仿。如都采用平衡传输方式、都需要在传输线上接终接电阻等。RS-485可以采用二线与四线方式,二线制可实现真正的多点双向通信。 下面介绍以下rs485通讯接口定义的标准 1.英式标识为TDA(-) 、TDB(+) 、RDA(-) 、RDB(+) 、GND 2.美式标识为Y 、Z 、A 、B 、GND 3.中式标识为TXD(+)/A 、TXD(-)/B 、RXD(-) 、RXD(+)、GND rs485两线一般定义为: "A, B"或"Date+,Date-" 即常说的:”485+,485-” rs485四线一般定义为: "Y,Z,A, B," 一般rs485协议的接头没有固定的标准,可能根据厂家的不同引脚顺序和管脚功能可能不尽相同,但是官方一般都会提供产品说明书,用户可以查阅相关 rs485管脚图定义或者引脚图 上图中rs232转rs485电路中hin232(max232可以起到同样的作用但是要贵一点)起到转

换pc端rs232接口电平的作用,然后把信号由max485这个芯片转换成485电平由AB两根线输出,如果接上双绞线信号rs485总线接口的信号的通信距离至少是1千米远。

RS-485总线标准及几种常见的RS-485接口电路介绍

RS-485总线标准及几种常见的RS-485接口电路介绍 本文主要简单介绍RS-485总线标准,以及比较几种常见的RS-485电路,并重点介绍美国模拟器公司(ADI)最新量产的具备±15 kV ESD保护功能的完全集成式隔离数据收发器 ADM2582E/ADM2587E,一个集成隔离DC/DC电源,适合用于多点传输线路上的高速通信应用的数据收发器。 1.引言 随着现代化社会生活的迅速发展,工业自动化的程度越来越高。在工业控制、电力通讯、智能仪表等领域中,也常常使用简便易用的串行通讯方式作为数据交换的手段。但是,在工业控制等环境中,常会有电气噪声干扰传输线路,使用RS-232通讯时经常因外界的电气干扰而导致信号传输错误;另外,RS-232通讯的最大传输距离在不增加缓冲器的情况下只可以达到15 米。为了解决上述问题,RS-485标准通常被用作为一种相对经济、具有相当高噪声抑制、相对高的传输速率、传输距离远、宽共模范围的通信平台。 RS-485标准采用平衡式发送,差分式接收的数据收发器来驱动总线。因为RS-485的远距离、多节点(256个)以及传输线成本低的特性,是EIA RS-485称为工业应用中数据传输的首选标准。ADI公司的ADM2582E/ADM2587E器件针对均衡的传输线路而设计,符合ANSI/TIA/EIA RS-485-A-98和ISO 8482:1987(E)标准。它采用ADI公司的iCoupler?技术,在单个封装内集成了一个三通道隔离器、一个三态差分线路驱动器、一个差分输入接收机和一个isoPower DC/DC转换器。该器件采用5V或3.3V单电源供电,从而实现了完全隔离的RS-485解决方案。 2.RS-485 标准介绍 电子工业协会(EIA)于1983 年制订并发布RS-485标准,并经通讯工业协会(TIA)修订后命名为TIA/EIA-485-A,习惯地称之为RS-485标准。RS-485标准是为弥补RS-232通信距离短、速率低等缺点而产生的。RS-485标准只规定了平衡发送器和接收器的电特性,而没有规定接插件、传输电缆和应用层通信协议。RS-485标准数据信号采用差分传输方式(Differential Driver Mode),也称作平衡传输,RS-485标准的最大传输距离约为1219 米。通常,RS-485网络采用平衡双绞线作为传输媒体,平衡双绞线的长度与传输速率成反比。在这里尤为注意并不是所有的RS-485收发器都能够支持高达10Mbps的通讯速率。如果采用光电隔离方式,则通讯速率一般还会受到光电隔离器件响应速度的限制。 3.几种典型的RS485电路设计 (1)、传统的RS485电路

RS485接线的正确原理图

RS232 通讯原理 ? RS485通讯原理?RS422 是什么? RS485接线的正确原理图常见的RS485错误接线 RS-232是串行数据接口标准,最初都是由电子工业协会(EIA)制订并发布的,RS-232在1962年发布,命名为EIA-232-E,作为工业标准,以保证不同厂家产品之间的兼容。RS-422由RS-232发展而来,它是为弥补RS-232之不足而提出的。为改进RS-232通信距离短、速率低的缺点,RS-422定义了一种平衡通信接口,将传输速率提高到10Mb/s,传输距离延长到4000英尺(速率低于100kb/s时),并允许在一条平衡总线上连接最多10个接收器。RS-422是一种单机发送、多机接收的单向、平衡传输规范,被命名为 TIA/EIA-422-A标准。为扩展应用范围,EIA又于1983年在RS-422基础上制定了RS-485标准,增加了多点、双向通信能力,即允许多个发送器连接到同一条总线上,同时增加了发送器的驱动能力和冲突保护特性,扩展了总线共模范围,后命名为TIA/EIA-485-A标准。由于EIA提出的建议标准都是以“RS”作为前缀,所以在通讯工业领域,仍然习惯将上述标准以RS作前缀称谓。 备注:以上是官方的专业描述,看不懂没有关系,大致有个印象就可以了,有兴趣的可以上网可以买一些专业书籍做深入研究,我再用通俗的语言补充描述一下。 RS232通讯的基础知识: RS232通讯又叫串口通讯方式。是指计算机通过RS232国际标准协议用串口连接线和单台设备(控制器)进行通讯的方式。 通讯距离:9600波特率下建议在13米以内。 通讯速率(波特率Baud Rate):缺省常用的是9600 bps,常见的还有1200 2400 4800 19200 38400等。波特率越大,传输速度越快,但稳定的传输距离越短,抗干扰能力越差。

单片机上的RS485接口

单片机上的RS485接口 RS-232虽然应用很广泛,但因为它推出较早,在现代网络通信中已经暴露出明显的缺点。比如以下几点: 1)数据传输速率慢。RS-232所规定的20KB/s的传输速率虽然能满足异步通信要求,通常异步通信速率限制在19.2KB/s以下对某些同步系统来说,不能满足传送速率 要求。 2)传送距离短。RS-232接口一般装置之间电缆长度为15m,即使有较好的线路器件优良的信号质量,电缆长度也不会超过60m。 3)没有规定标准的连接器,因而出现了互不兼容的25芯连接器。 4)接口处各信号间容易产生串扰。 RS-485接口的出现就弥补了RS-232的不足,而出现了一种新的接口标准,并且由于良好的性能,RS-485获得了广泛的应用,其具有以下特点: 1)RS-485的电气特性:逻辑“1”以两线间的电压差为+(2~6)V表示?逻辑“0”以两线间的电压差为-(2~6)V表示。接口信号电平比RS-232降低了,就不易损坏接口 电路的芯片,且该电平与TTL电平兼容,可方便与TTL电路连接。 2)RS-485的数据最高传输速率为10MB/s。 3)RS-485接口是采用平衡驱动器和差分接收器的组合,抗共模干能力增强,即抗噪声干扰性好。 4)RS-485接口的最大传输距离标准值为4000英尺,实际上可达1000米,另外RS-232接口在总线上只允许连接1个收发器,即单站能力。而RS-485接口在总线上是允 许连接多达128个收发器。即具有多站能力,这样用户可以利用单一的RS-485 接口方便地建立起设备网络。 RS-485收发器SN65HVD3082的使用方法 1)SN65HVD3082简介 此芯片是半双工RS-485收发器。5V供电,全完符合TIA/EIA-485A标准。它可以应用于传输速率低于200kbps的场合,并且工作电流低于0.6mA。 芯片的宽适用范围与高ESD保护使它可以满足诸如能量测量网络、电力转换、远程通信中的状态与命令传输和工业自动化网络等场合的要求。另外,片内集成上

RS232RS422RS485通信接口区别解析

RS232/RS422/RS485通信接口区别 一串口控制 通常我们对于视频服务器、录像机、切换台等直接播出、切换控制主要使用串口进行,主要使用到 RS-232、 RS-422与 RS-485三种接口控制。下面就串口的接口标准以及使用和外部插件和电缆进行探讨。 RS-232、 RS-422与 RS-485标准只对接口的电气特性做出规定,而不涉及接插件、电缆或协议, 在此基础上用户可以建立自己的高层通信协议。例如:视频服务器都带有多个 RS422串行通讯接口,每个接口均可通过 RS422通讯线由外部计算机控制实现记录与播放。视频服务器除提供各种控制硬件接口外,还提供协议接口,如RS422接口除支持 RS422的 Profile 协议外,还支持 Louth、 Odetics 、 BVW 等通过RS422控制的协议。 RS-232、 RS-422与 RS-485都是串行数据接口标准,都是由电子工业协会(EIA 制订并发布的, RS-232在 1962年发布。 RS-422由 RS-232发展而来,为改进 RS-232通信距离短、速率低的缺点, RS-422定义了一种平衡通信接口,将传输速率提高到10Mbps ,传输距离延长到 4000英尺(速率低于 100Kbps 时,并允许在一条平衡总线上连接最多 10个接收器。 RS-422是一种单机发送、多机接收的单向、平衡传输规范,被命名为 TIA/EIA-422-A标准。为扩展应用范围, EIA 又于 1983年在 RS-422基础上制定了 RS-485标准,增加了多点、双向通信能力,即允许多个发送器连接到同一条总线上,同时增加了发送器的驱动能力和冲突保护特性,扩展了总线共模范围,后命名为 TIA/EIA-485-A 标准。 1. S-232串行接口标准 目前 RS-232是 PC 机与通信工业中应用最广泛的一种串行接口。 RS-232被定义为一种在低速率串行通讯中增加通讯距离的单端标准。 RS-232采取不平衡传输方式,即所谓单端通讯。收、发端的数据信号是相对于信号地。典型的 RS-232信号在正负电平之间摆动,在发送数据时,发送端驱动器输出正电平在 +5~+15V,负电

RS-485 接口电路

RS-485 接口电路 RS-485 接口电路的主要功能是:将来自微处理器的发送信号TX 通过“发送器”转换成通讯网络中的差分信号,也可以将通讯网络中的差分信号通过“接收器”转换成被微处理器接收的RX 信号。任一时刻,RS-485 收发器只能够工作在“接收”或“发送”两种模式之一,因此,必须为RS-485 接口电路增加一个收/发逻辑控制电路。另外,由于应用环境的各不相同,RS-485 接口电路的附加保护措施也是必须重点考虑的环节。下面以选用SP485R 芯片为例,列出RS-485 接口电路中的几种常见电路,并加以说明。 1.基本RS-485 电路 图1为一个经常被应用到的SP485R芯片的示范电路,可以被直接嵌入实际的RS-485应用电路中。微处理器的标准串行口通过RXD 直接连接SP485R 芯片的RO 引脚,通过TXD直接连接SP485R 芯片的DI 引脚。 由微处理器输出的R/D 信号直接控制SP485R 芯片的发送器/接收器使能:R/D 信号为“1”,则SP485R 芯片的发送器有效,接收器禁止,此时微处理器可以向RS-485 总线发送数据字节;R/D 信号为“0”,则SP485R 芯片的发送器禁止,接收器有效,此时微处理器可以接收来自RS-485 总线的数据字节。此电路中,任一时刻SP485R 芯片中的“接收器”和“发送器”只能够有1 个处于工作状态。 连接至A 引脚的上拉电阻R7、连接至B 引脚的下拉电阻R8 用于保证无连接的 SP485R芯片处于空闲状态,提供网络失效保护,以提高RS-485 节点与网络的可靠性。R7,R8,R9这三个电阻要根据实际应用而改变大小,特别在用120欧或更小终端电阻时,R9就不需要了,R7和R8应使用680欧电阻。 如果将SP485R 连接至微处理器80C51 芯片的UART 串口,则SP485R 芯片的RO 引脚不需要上拉;否则,需要根据实际情况考虑是否在RO 引脚增加1 个大约10K 的上拉电阻。

RS232-422-485接口定义

RS232接口 RS232接口是1970年由美国电子工业协会(EIA)联合贝尔系统、调制解调器厂家及计算机终端生产厂家共同制定的用于串行通讯的标准。它的全名是“数据终端设备(D TE)和数据通讯设备(DCE)之间串行二进制数据交换接口技术标准”。 该标准规定采用一个25个脚的DB25连接器,对连接器的每个引脚的信号内容加以规定,还对各种信号的电平加以规定。随着设备的不断改进,出现了代替DB25的D B9接口,现在都把RS232接口叫做DB9。 RS-232是现在主流的串行通信接口之一。 由于RS232接口标准出现较早,难免有不足之处,主要有以下四点: (1)接口的信号电平值较高,易损坏接口电路的芯片,又因为与TTL电平不兼容故需使用电平转换电路方能与TTL电路连接。 (2)传输速率较低,在异步传输时,波特率为20Kbps;因此在“南方的老树51 CPLD开发板”中,综合程序波特率只能采用19200,也是这个原因。 (3)接口使用一根信号线和一根信号返回线而构成共地的传输形式,这种共地传输容易产生共模干扰,所以抗噪声干扰性弱。 (4)传输距离有限,最大传输距离标准值为50英尺,实际上也只能用在50米左右。 接口定义 RS232(DB9) 1 DCD 载波检测 2 RXD 接收数据 接口说明 3 TXD 发送数据 4 DTR 数据终端准备好 5 SG 信号地 6 DSR 数据准备好 7 RTS 请求发送 8 CTS 清除发送 9 RI 振铃提示 接口电平 RS232采用负逻辑电平: -15~-3:逻辑1;

+15~+3:逻辑0; 电压值通常在7V左右 RS-422 RS-422接口是一种单机发送、多机接收的单向、平衡传输规范,被命名为TIA/EIA-422-A 标准。为扩展应用范围,EIA又于1983年在RS422接口基础上制定了RS-485标准,增加了多点、双向通信能力,即允许多个发送器连接到同一条总线上,同时增加了发送器的驱动能力和冲突保护特性,扩展了总线共模范围,后命名为TIA/EIA-485-A标准。由于EIA提出的建议标准都是以“RS”作为前缀,所以在通讯工业领域,仍然习惯将上述标准以RS作前缀称谓。 RS422接口标准全称是“平衡电压数字接口电路的电气特性”,它定义了接口电路的特性。实际上还有一根信号地线,共5根线。由于接收器采用高输入阻抗和发送驱动器比RS232更强的驱动能力,故允许在相同传输线上连接多个接收节点,最多可接10个节点。即一个主设备(Master),其余为从设备(Salve),从设备之间不能通信,所以RS422接口支持点对多的双向通信。接收器输入阻抗为4k,故发端最大负载能力是10×4k+100Ω(终接电阻)。RS422接口四线接口由于采用单独的发送和接收通道,因此不必控制数据方向,各装置之间任何必须的信号交换均可以按软件方式(XON/XOFF握手)或硬件方式(一对单独的双绞线)。 RS422接口的最大传输距离为4000英尺(约1219米),最大传输速率为10Mb/s。其平衡双绞线的长度与传输速率成反比,在100kb/s速率以下,才可能达到最大传输距离。只有在很短的距离下才能获得最高速率传输。一般100米长的双绞线上所能获得的最大传输速率仅为1Mb/s。 RS422接口需要一终接电阻,要求其阻值约等于传输电缆的特性阻抗。在矩距离传输时可不需终接电阻,即一般在300米以下不需终接电阻。终接电阻接在传输电缆的最远端。 下面是关于RS-422线的接法: 25 Pin of RS-422 9 Pin of RS-422 SD-A 15(线号) 3(线号) R- RD-B 22(线号) 2(线号) T- SD-B 14(线号) 7(线号) R+ RD-B 21(线号) 8(线号) T+ 表格 4线制的RS-422 注意: 如果RS-422为两线制,那么R-和T-就在一根线上,R+和T+也同样在一根线上。计算机侧 RS422 串行通信接口的插口是 25 针公插: RS485接口 RS485采用差分信号负逻辑,+2V~+6V表示“0”,- 6V~- 2V表示“1”。RS485 有两线制和四线制两种接线,四线制只能实现点对点的通信方式,现很少采用,现在多采用的是两线制接线方式,这种接线方式为总线式拓朴结构在同一总线上最多可以挂接32个结

RS232接口,RS485接口, RS422接口

RS232接口 串行通信的基本原理 串行端口的本质功能是作为CPU和串行设备间的编码转换器。当数据从CPU经过串行端口发送出去时,字节数据转换为串行的位。在接收数据时,串行的位被转换为字节数据。 在Windows环境(Windows NT、Win98、Windows2000)下,串口是系统资源的一部分。应用程序要使用串口进行通信,必须在使用之前向操作系统提出资源申请要求(打开串口),通信完成后必须释放资源(关闭串口)。串口通信程序的流程如下图: 串口信号线的接法 一个完整的RS-232C接口有22根线,采用标准的25芯插头座(或者9芯插头座)。25芯和9芯的主要信号线相同。以下的介绍是以25芯的RS-232C为例。 1、主要信号线定义: 引脚 1:保护地;引脚2:发送数据TXD;引脚3:接收数据RXD;引脚4:请求发送RTS;引脚5:清除发送CTS;引脚6:数据设备就绪DSR;引脚 7:信号地;引脚 8:数据载波检测DCD;引脚20:数据终端就绪DTR; 2、电气特性: 数据传输速率最大可到20K bps,最大距离仅15m。注:看了微软的MSDN 6.0,其Windows API中关于串行通讯设备(不一定都是串口RS-232C或RS-422或RS-449)速率的设置,最大可支持到RS_256000,即256K bps! 也不知道到底是什么串行通讯设备?但不管怎样,一般主机和单片机的串口通讯大多都在9600 bps,可以满足通讯需求。 3、接口的典型应用:大多数计算机应用系统与智能单元之间只需使用3到5根信号线即可工作。这时,除了TXD、RXD以外,还需使用RTS、CTS、DCD、DTR、DSR等信号线。(当然,在程序中也需要对相应的信号线进行 设置。) 以上接法,在设计程序时,直接进行数据的接收和发送就可以了,不需要对信号线的状态进行判断或设置。

rs485总线接口通讯协议定义标准以及管脚引脚

rs485总线接口通讯协议定义标准以及管脚引脚 [日期:2009-01-01 ] [来源:net 作者:佚名] [字体:大中小] (投递新闻) RS485总线标准是工业中(考勤,监控,数据采集系统)使用非常广泛的双向、平衡传输标准接口,支持多点连接,允许创建多达32个节点的网络;最大传输距离1200m,支持1200 m时为100kb/s的高速度传输,抗干扰能力很强,布线仅有两根线很简单。 RS485通信网络接口是一种总线式的结构,上位机(以个人电脑为例)和下位机(以51系列单片机https://www.docsj.com/doc/da4642940.html,为例)都挂在通信总线上,RS485物理层的通信协议由RS485标准和51单片机的多机通讯方式。由于RS-485是从RS-422基础上发展而来的,所以RS-485许多电气规定与RS-422相仿。如都采用平衡传输方式、都需要在传输线上接终接电阻等。RS-485可以采用二线与四线方式,二线制可实现真正的多点双向通信。 下面介绍以下rs485通讯接口定义的标准 1.英式标识为TDA(-) 、TDB(+) 、RDA(-) 、RDB(+) 、GND 2.美式标识为Y 、Z 、A 、B 、GND 3.中式标识为TXD(+)/A 、TXD(-)/B 、RXD(-) 、RXD(+)、GND rs485两线一般定义为:

"A, B"或"Date+,Date-" 即常说的:”485+,485-” rs485四线一般定义为: "Y,Z,A, B," 一般rs485协议的接头没有固定的标准,可能根据厂家的不同引脚顺序和管脚功能可能不尽相同,但是官方一般都会提供产品说明书,用户可以查阅相关rs485管脚图定义或者引脚图 上图中rs232转rs485电路中hin232(max232可以起到同样的作用但是要贵一点)起到转换pc端rs232接口电平的作用,然后把信号由max485这个芯片转换成485电平由AB两根线输出,如果接上双绞线信号rs485总线接口的信号的通信距离至少是1千米远。 参考链接:https://www.docsj.com/doc/da4642940.html,/news/2009-01/8751.htm 参考链接:https://www.docsj.com/doc/da4642940.html,/news/2009-01/8751.htm

rs-485接口定义

rs-485b就是RS485的通信协议低电平数据接收端 1. RS-485的电气特性:逻辑"1"以两线间的电压差为+(2-6) V表示;逻辑"0"以两线间的电压差为-(2-6)V表示。接口信号电平比RS-232-C降低了,就不易损坏接口电路的芯片,且该电平与TTL电平兼容,可方便与TTL电路连接。 2. RS-485的数据最高传输速率为10Mbps 3. RS-485接口是采用平衡驱动器和差分接收器的组合,抗共模干能力增强,即抗噪声干扰性好。 4. RS-485接口的最大传输距离标准值为4000英尺,实际上可达3000米,另外RS-232-C接口在总线上只允许连接1个收发器,即单站能力。而RS-485接口在总线上是允许连接多达128个收发器。即具有多站能力,这样用户可以利用单一的RS-485接口方便地建立起设备网络。因RS-485接口具有良好的抗噪声干扰性,长的传输距离和多站能力等上述优点就使其成为首选的串行接口。因为RS485接口组成的半双工网络,一般只需二根连线,所以RS485接口均采用屏蔽双绞线传输。RS485接口连接器采用DB-9的9芯插头座,与智能终端RS485接口采用DB-9(孔),与键盘连接的键盘接口RS485采用DB-9(针) RS485接口定义图 1 连接主机端的RS485接口。 ----信号定义如下: ----RS485接口 --------信号含义 ---- 3 -----------B RXD- 接收数据 ---- 4 ------------A RXD+ 接收数据 ---- 5------------ Y TXD+ 发送数据 ---- 7------------ Z TXD- 发送数据 2-连接从机端的RS485接口。 ----信号定义如下: ----RS485接口--------- 信号含义 ---- 3------------ Z TXD- 发送数据 ---- 4------------ Y TXD+ 发送数据 ---- 5------------ A RXD+ 接收数据 ---- 7------------ B RXD- 接收数据 接口如果连接主机,那么该信号位置为3脚,接口如果连接从机,那么该信号位置为7脚。

RS232和RS485正确接线原理图

RS232和RS485接线的正确原理图 RS-232是串行数据接口标准,最初都是由电子工业协会(EIA)制订并发布的,RS-232在1962年发布,命名为EIA-232-E,作为工业标准,以保证不同厂家产品之间的兼容。RS-422由RS-232发展而来,它是为弥补RS-232之不足而提出的。为改进RS-232通信距离短、速率低的缺点,RS-422定义了一种平衡通信接口,将传输速率提高到10Mb/s,传输距离延长到4000英尺(速率低于100kb/s时),并允许在一条平衡总线上连接最多10个接收器。RS-422是一种单机发送、多机接收的单向、平衡传输规范,被命名为 TIA/EIA-422-A标准。为扩展应用范围,EIA又于1983年在RS-422基础上制定了RS-485标准,增加了多点、双向通信能力,即允许多个发送器连接到同一条总线上,同时增加了发送器的驱动能力和冲突保护特性,扩展了总线共模范围,后命名为TIA/EIA-485-A标准。由于EIA提出的建议标准都是以“RS”作为前缀,所以在通讯工业领域,仍然习惯将上述标准以RS作前缀称谓。 备注:以上是官方的专业描述,看不懂没有关系,大致有个印象就可以了,有兴趣的可以上网可以买一些专业书籍做深入研究,我再用通俗的语言补充描述一下。 RS232通讯的基础知识: RS232通讯又叫串口通讯方式。是指计算机通过RS232国际标准协议用串口连接线和单台设备(控制器)进行通讯的方式。 通讯距离:9600波特率下建议在13米以内。 通讯速率(波特率Baud Rate):缺省常用的是9600 bps,常见的还有1200 2400 4800 19200 38400等。波特率越大,传输速度越快,但稳定的传输距离越短,抗干扰能力越差。 备注:一般台式机会自带1-2个串口插座(公头(9针插头上带针的俗称公头,带针孔的俗称母头)),现在的笔记本一般不带串口插座,可以购买USB串口转换器,具体请参考怎样使用USB串口转换器?

常用通信接口标准(RS232、485、I2C等)

GPIB 一、简介: GPIB(General-Purpose Interface Bus)-通用接口总线,大多数打印机就是通过GPIB线以及GPIB接口与电脑相连。 1965年惠普公司设计HP-IB 1975年HP-IB变成IEEE-488标准 1987年IEEE488.2被采纳, IEEE 488-1978变成IEEE488.1-1987 1990年SCPI规范被引入IEEE 488仪器 1992年修订IEEE 488.2 1993年NI公司提出HS488 1965年, 惠普公司(Hewlett-Packard)设计了惠普接口总线(HP-IB, 用于连接惠普的计算机和可编程仪器.由于其高转换速率(通常可达1Mbytes/s), 这种接口总线得到普遍认可, 并被接收为IEEE标准488-1975和ANSI/IEEE标准488.1-1987. 后来, GPIB比HP-IB的名称用得更广泛. ANSI /IEEE 488.2 -1987加强了原来的标准, 精确定义了控制器和仪器的通讯方式. 可编程仪器的标准命令(Standard Commands for Programmable Instruments, SCPI)采纳了IEEE488.2定义的命令结构,创建了一整套编程命令 二、接口与总线 接口部分是由各种逻辑电路组成,与各仪器装置安装在一起,用于对传输的

传输各种消息。将具有GPIB接口的仪器用GPIB总线连接起来的标准接口总线系统。 在一个GPIB标准接口总线系统中,要进行有效的通信联络至少有“讲者”、“听者”、“控者”三类仪器装置。 讲者是通过总线发送仪器消息的仪器装置(如测量仪器、数据采集器、计算机等),在一个GPIB系统中,可以设置多个讲者,但在某一时刻,只能有一个讲者在起作用。 听者是通过总线接收由讲者发出消息的装置(如打印机、信号源等),在一个GPIB系统中,可以设置多个听者,并且允许多个听者同时工作。 控者是数据传输过程中的组织者和控制者,例如对其他设备进行寻址或允许“讲者”使用总线等。控者通常由计算机担任,GPIB系统不允许有两个或两个以上的控者同时起作用。 三、接口系统的基本特征 (1)可以用一条总线互相连接若干台装置,以组成一个自动测试系统。系统中装置的数目最多不超过15台,互连总线的长度不超过20m。 (2)数据传输采用并行比特(位)、串行字节(位组)双向异步传输方式,其最大传输速率不超过1兆字节每秒。? (3)总线上传输的消息采用负逻辑。低电平(≤+0.8V)为逻辑“1”,高电平(≥+2.0V)为逻辑“0”。 (4)地址容量。单字节地址:31个讲地址,31个听地址;双字节地址:961个讲地址,961个听地址。

RS232、RS485、RS422接口方式含义

什么是RS232、RS485、RS422接口方式? (一)RS-232 是个人计算机上的通讯接口之一,由电子工业协会(Electronic Industries Association,EIA) 所制定的异步传输标准接口。通常 RS-232 接口以9个接脚(DB-9) 或是25个接脚 (DB-25) 的型态出现,一般个人计算机上会有两组 RS-232 接口,分别称为 COM1 和 COM2。 RS-232-C RS-232-C是美国电子工业协会EIA(Electronic Industry Association)制定的一种串行物理接口标准。RS是英文“推荐标准”的缩写,232为标识号,C 表示修改次数。RS-232-C总线标准设有25条信号线,包括一个主通道和一个辅助通道。 在多数情况下主要使用主通道,对于一般双工通信,仅需几条信号线就可实现,如一条发送线、一条接收线及一条地线。 RS-232-C标准规定的数据传输速率为每秒50、75、100、150、300、600、1200、2400、4800、9600、19200波特。 RS-232-C标准规定,驱动器允许有2500pF的电容负载,通信距离将受此电容限制,例如,采用150pF/m的通信电缆时,最大通信距离为15m;若每米电缆的电容量减小,通信距离可以增加。传输距离短的另一原因是RS-232属单端信号传送,存在共地噪声和不能抑制共模干扰等问题,因此一般用于20m 以内的通信。 串行通信接口标准经过使用和发展,目前已经有几种。但都是在RS-232标准的基础上经过改进而形成的。所以,以RS-232C为主来讨论。RS-323C 标准是美国EIA(电子工业联合会)与BELL等公司一起开发的1969年公布的通信协议。它适合于数据传输速率在0~20000b/s范围内的通信。这个标准对串行通信接口的有关问题,如信号线功能、电器特性都作了明确规定。由于通行设备厂商都生产与RS-232C制式兼容的通信设备,因此,它作为一种标准,目前已在微机通信接口中广泛采用。 在讨论RS-232C接口标准的内容之前,先说明两点: 首先,RS-232-C标准最初是远程通信连接数据终端设备DTE(Data Terminal Equipment)与数据通信设备DCE(Data Communication Equipment)而制定的。因此这个标准的制定,并未考虑计算机系统的应用要求。但目前它又广泛地被借来用于计算机(更准确的说,是计算机接口)与终端或外设之间的近端连接标准。显然,这个标准的有些规定及和计算机系统是不一致的,甚至是相矛盾的。有了对这种背景的了解,我们对RS-232C标准与计算机不兼容的地方就不难理解了 其次,RS-232C标准中所提到的“发送”和“接收”,都是站在DTE立场上,而不是站在DCE的立场来定义的。由于在计算机系统中,往往是CPU和I/O 设备之间传送信息,两者都是DTE,因此双方都能发送和接收。 一、RS-232-C RS-232C标准(协议)的全称是EIA-RS-232C标准,其中EIA(Electronic Industry Association)代表美国电子工业协会,RS(recommeded standard)代表推荐标准,232是标识号,C代表RS232的最新一次修改(1969),在这之前,有RS232B、RS232A。。它规定连接电缆和机械、电气特性、信号功能及传送过程。常用物理标准还有有EIA�RS-232-C、EIA�RS-422-A、

RS485 接口介绍 RS

一、RS485 接口介绍RS-485 采用平衡发送和差分接收方式实现通信,其接口详细的电器 参数如下:接口定义:A、B 工作电压:-7V-12V 信号速率:10Mb/s 接口电缆:双绞屏蔽电缆走线方式:根据实际的情况进行走线,最大长度1000m 二、EMC 设计要求RS485 用于设备与计算机或其它设备之间通讯,应用与空调产品时其走线时多与电源、功率信号等混合在一起,RS485 接口设计可能会影响的EMC 问题如下:1、辐射发射问题:RS485 接口会带出单板内部的干扰,通过电源线形成对外辐射,导致辐射发射测试超标;2、抗干扰问题:RS485 会受外界干扰会导致通讯异常,如脉冲群干扰、射频干扰在空调产品使用时会因压缩机、风机、电磁阀等干扰源,导致通讯异常; 因RS485 走线长,有可能存在户外走线,因此要考虑防雷设计; 二、三、RS485 接口原理设计 三、RS485 接口原理设计 1. D1、D2 为气体放电管,主要用来泄放共模浪涌能量,气体放电管击穿电压300V,通流量1kA; 2. D3、D4、D5 为半导体放电管,主要用来泄放共模以及差模浪涌能量,半导体放电管型号BS0300N-C,其导通电压为40V,通流量为100A; 3. R1、R2 选用10Ω,(不用逗号)1/2W 的电阻,因半导体放电管启动电压要低于气体放电管,为保证气体放电管能顺利的导通,泄放大能量必须增加此电阻(R1、R2)进行分压,确保大部分能量通过气体放电管泄放,半导体放电管作精细防护; 4. C1、C2 电容,给干扰提供低阻抗的回流路径,能有效减小对外的共模干扰电流同时对外界干扰能适当的滤波;此电容容值可以根据实际的情况进行调整,从22pF至1000pF,典型值为100pF; 5. 共模电感能够对衰减共模干扰,对单板内部的干扰以及外部的干扰都能抑制,能提高产品的抗干扰能力,同时也能减小通过信号电缆对外的辐射,共模电选择100MHz 时阻抗为2200Ω的器件; 6. 在实际测试中如果接口存在EMC 问题,以上元器件均可调整,具体元器件调整参数参照《常用电磁兼容器件选型规范》。四、RS485 接口PCB 设计PCB 设计要点:1、元器件布局要紧凑,元器件位置要按照信号流向进行布局;2、遵循先防护后滤波的原则;3、地设计时要保证防护地与数字地隔离;4、信号走线要平行等长走线;5、在进行PCB 铺铜时,注意防护器件以及共模电感正下方掏空处理。

相关文档