文献翻译—RS-232串行接口_第1页
文献翻译—RS-232串行接口_第2页
文献翻译—RS-232串行接口_第3页
文献翻译—RS-232串行接口_第4页
文献翻译—RS-232串行接口_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

RS-232 串行接口RS-232 是在任何 时候都常用的接口之一。它不仅已经被内置于每台 PC,而且已被内置于从微控制器到主机的多种类型的电脑和与它们连接的设备。RS-232 的最通常得用处是连接到一个 Modem,其他拥 有 RS-232 接口的设备包括打印机,数据采集模块,测试装置和控制回路。你也可以将 RS-232 用在任何类型得计算机之间的简单连接中。RS-232 是设计 来处理两台 设备之间的通信的,距离限制为 50 到 100f,这决定于波特率和电缆类型。因 为 RS-232 端口被广泛应用,它的另一个用途是与一个将这个接口转换成另一种类型的适配器相连。例如,一个简单的回路将一个RS-232 端口转换 成一个 RS-485 端口,这个端口可以和多台 设备相连并且可以使用更长的导线连线。RS-232 连接使用非平衡 导线 。尽管一个非平衡的状态听起来像是一些应该避免的东西,在这里它仅仅 是指导线中的信号的电气特性。在一条非平衡导线中,信号电压加到一条导线上,所有的信号电压都使用一个公共的接地线。这种类型的接口的另一个术语是单端。特性RS-232 有几个优点: 它是无处不在的。每一台 PC 机都有一个或更多的 RS-232 端口。更新的计算机现在支持其他诸如 USB 这样的串行接口,但是 RS-232 可以做很多 USB 无法做的事情。 在微控制器中,接口芯片使得将一个 5V 串口转换成 RS-232 变得很容易。 连接距离可以达到 50 到 100ft。大多数的外 设接口都不会用于太长的距离。USB 连接最长可以达到 16ft,PC 机的并口打印机接口与主机的距离可以达到 10 到 15ft,或者利用 IEEE-1284B 型驱动器可以达到 30ft。但是 RS-232可以使用更长的电缆。如果每一个 RS-232 端口与一个 Modem 相连,你可以使用电话网在世界范围内发送数据。 对于一个双向连接,你只需要 3 条导线。一个并行连接一般需要 8 条数据线,两条或者更多的控制信号线,和几条接地 线。所有的 导线和更大的连接器使得价格累计起来就比较高了。RS-232 的缺点包括以下这些: 如果连接的另一头需要并行数据,它不得不将这个串口数据转换成并行数据。但是利用一个 UART,这很容易实现。 串口是如此的有用,以至于寻找一个未用的串口可能会比较困难。PC 机可以有多个串口,但是一个系统可能无法为每一个串口分配一个唯一的中断请求信号。大多数的微控制器只有一个硬件串口。 在一个连接中不能有超过 2 台以上的设备。 指定的最大数据传输速率是每秒 20000 位。但是,很多接口芯片可以超过这个数值,尤其是在短程连接上。 很长的连接需要一个不同的接口。双向 RS-232 通信的 3 个基本信号如下:TD:将数据从 DCE 传输到 DCE 也被称作 TX 和 TXD。RD:将数据从 DCE 传输到 DTE。也被称作 RX 和 RXD。SG:信号地。也被称作 GND 和 SGND。电压RS-232 的 逻辑电平用正 负电压表示,而不是只用 5V TTL 和 CMOS 逻辑的正电压信号表示。在一个 RS-232 的数据输出(TD),一个逻辑 0 被定义为等于或者高于+5V,而一个逻辑 1 被定义为等于-5V 或者比低于-5V。 换言之,信号使用负逻辑,在这种逻辑中,负的电压为逻辑 1。 控制信号使用相同的电压,但是使用的是正逻辑。一个正的电压表示这项功能为开,而一个负的电压表示这个功能为关。RS-232 接口芯片反向转换这些信号。在一个 UART 的输出引脚,一个 逻辑 1 数据位或者一个关控制信号接近于 5V,它在 RS-232 的接口产生一个负电压。一个逻辑 0 数据位或者一个开控制信号接近于 0V,它在 RS-232 接口产生一个正电压。因为一个 RS-232 接收器可能位于一条 长电线缆的末端,等到信号到达接收者的时候,它的电压可能已经削弱了或者加载了噪声信号。考虑到这种情况,在接受方最低要求的电压要比在驱动器处要低。一个比+3V 高得多的输入在 RD 处是一个逻辑 0,或者在一个控制输入处是一个开。一个比-3V 要低得多的输入在RD 处为一个逻辑 1,或者在一个控制输入处为一个关。根据这个标准,在-3V 和+3V 之间的一个输入的逻辑电 平没有定义。噪声容限,或者电压容限,是输出电压和输入电压的区别所在。 RS-232 的大电压波动导致一个比 5V TTL 逻辑宽得多的噪声容限。例如,即便一个 RS-232驱动器的输出为最小的+5V,它也会在接受方削弱或者噪声峰值大到 2V,并且仍旧是一个有效逻辑 0。很多 RS-232 输出有更宽的电压波动:9V 和 12V 是很平常的事情。这些都导致更宽的噪声容限。最大允 许的电压波动是 15V,尽管接受方必须不受任何损害地处理高达 25V 的电压。使用的另外两个与 RS-232 有关的术语是 Mark 和 Space。Space 是逻辑 0,而 Mark 是逻辑 1。这两个术语是多年以前机械记录仪二进制数据的,他们分别代表物理标记和空白。计时限制TIA/EIA-232 包括最小和最大 计时规定。所有的 RS-232 接口芯片都符合这个规定。指定的旋转速度限制了接口的最大比特率。旋转率是当输出切换时电压变化的快慢的量度,并且描述了一个输出的电压变化的瞬间速度。一个 RS-232 驱动器的旋转速度必须是每毫秒 30V 或者更少。限制旋转速度的好处是它通过事实上消除由于电压偏转引发的问题来改进信号质量,电压偏移发生在 传输有着快速上升和下降节拍的信号的长距离连线上。但是旋转速度也限制了一个连接的最大速度。在 30V/us 的速度下,一个输出需要 0.3us 从+5V 切换到 -5V。RS-232 的规定的最大波特率为 20kbps,这个速度转换成一个比特宽度为 50us,或者在允许的最快旋转速度下为 166 倍的切换时间。事实上,因为 UART 在位的中 间附近读取输入数据,并且还因为大多数的时间参考时钟是非常准确的,你可以安全的使用短到 5 到 10 倍的切换时间的位的宽度。考 虑到这些,有的接口芯片允许 115kbps 或者更高的波特率,即使这违反了这个标准的建议。除了有一个最大的切换速度之外,RS-232 驱动器还必须符合最低标准以确保信号不在逻辑状态之间的未定义区域停留。对于控制信号和其他 40bps 和更低的信号,信号线必须花费不超过 1ms 的时间在有效的 逻辑 1 和逻辑 0 之间的传送区域,对于其他数据和时间信号, 这个限制是 4%的位宽,或者在 20bps 下为 2us。信号的上升和下降次数也要尽可能的接近相等。在 5V 逻辑和 RS-232 之间转换很多微控制器有异步串口,但是它们的输出和输入使用 5V 逻辑而不是使用RS-232 电压。将 5V 落连 接到一个 RS-232 端口需要转换到 RS-232 电平和从 RS-232 电平转换到 5V 逻辑。利用 5V 逻辑,我假定了 TTL 或者 CMOS 逻辑芯片使用的逻辑电平,这些芯片是由一个单一的+5V 电 源供电,信号电平以接地 电平作为参考。对于 TTL 逻辑 ,一个逻辑低输入不高于 0.8V。一个逻辑高输出必须至少为2.4V,而一个逻辑高输入必 须至少为 2V。利用 这些 逻辑电平,一个接口可以有0.4V 的噪声信号而不至于产生错误。这些逻辑电平应用在初期的,标准的 7400 系列的 TTL 逻辑和他的派生系列,包括 74LS74F 和 74ALS TTL。较早的利用 NMOS 技术制造的微控制器也使用这些逻辑电平。大多数的 CMOS 芯片定义了不同的逻辑电平,并且有更宽的噪声容限。一个逻辑低 CMOS 输出不高于 0.1V,而一个 逻辑低输入可以高达 20%的电源电压,或者对于 5V 的电源输入可以达到 1V。一个逻辑高输出至少为 4.9V,而一个逻辑高输入必须至少达到电源电压的 70%,或者对于 5V 电源输入而言达到 3.5V。使用这样的逻辑电平的系列包括 4000 系列,74HC 和 74AC。有的 CMOS 芯片有 TTL 兼容输出。 这是得他们可以直接和 CMOS 或者 TTL逻辑项链。遵循这个惯例的芯片包括 74HCT 逻辑系列和大多数的微控制器。RS-232 InterfaceRS-232 is one of the normally used interfaces at any time, it not only built in every PC-set, but also built in any types of computers which are from microcontroller to host computers, and equipment connected with them. The general usage of RS-232 is to connect a modern, the other arrangements with RS-232 interfaces include printer, data collection module, testing device and control loop. RS-232 can be also used in the simple link of any type of computer.RS-232 is designed to deal with the communication between two arrangements with distance limitation from 50 to 100ft, which depend on Potter rate and type of electric cable. Because of wide application of RS-232 port, its other usage is to link another type of adapter converted form the port.For example, a simple loop changes a RS-232 into a RS-485 port. The port can be link with several devices by means of a long lead. Non-equilibrium lead is used to linked to RS-232. Although non-equilibrium should something avoidable, it only refers to the electric property of the signal in lead. In a non-equilibrium lead, signal voltage is applied to another lead, all has another technical term “signal end”.Advantages in RS-232RS-232 is used everywhere. Every PC-set has one or more RS-232 ports. The renewed computers sustain other serial interfaces like USB. But RS-232 can do many things which USB cant do.In the micro-controller interface chip can be easily used to change into RS-232.The jointing distance can reach 50-100ft. Many external interfaces are not used for too long distance. The longest distance joint of USB can reach 16ft. The distance between parallel printer interface on the PC-set and the host computer can reach 10 to 15ft, or 30ft by using Type TEEE-1284B driver. But RS-232 can use the longer electric cable.If every RS-232 port is linked with a modern, Telephone network can used to send data in the rage of the world.For a double link, 3 leads are needed. A parallel circuit generally needs 8 data lines, two or more control signal lines and ground wires。It is more expensive if more leads and bigger connectors are used.Disadvantages in RS-232If one side of link needs parallel data, it has to transform serial into parallel data. But if it is easily realized a UART is used.Because of the serial port so useful, it is maybe harder to look for a free serial port PC-set may have many serial ports, but a system maybe cant distribute a sole breaking enquiring signal to every serial port. Most micro-controller only has one hardware serial port.No more than 2 set in one link.The biggest designated transmitting rate of data is 2000bits/s.But many interface chip can surpass this numerical value, especially in the short distance link.A longer link needs a different interface.3 basic signals of the double RS-232 communication as follows:TD. Transform data DTE to DCE Its also called TX and TXD.RD. Transform data DCE to DTE Its also called RX and RXD.SG. Signal land. Its also called GND and SGND.VoltageLogic0 is a positive RS-232 voltage, the logic electric level of RS-232 is indicated with positive-negative, and not only use the positive voltage signal of the 5VTTL and CMOS logic to indicate. In the data logger(TD)of RS-232,a logic0 is defined equal to or higher than +5V, and a Logic1 defined equal to -5V or lower than -5V. In another word, signal use the negative logic, in this logic, the negative voltage is Logic1.Control signal uses the same voltage, but it uses positive logic. A positive voltage indicates this function is on and a negative voltage indicates this function is off.RS-232 interface chip transform these signals in reverse. In output pin of one UART, A logic1 datum or a off control signal is close to 5V, it produces negative voltage on the interface of RS-232.A logic0 datum or an on-control signal is close to 0V, it produces a positive voltage on the interface of RS-232.Because of the RS-232 receptor maybe at the end of a long electrical cable, when the signal reaches the receiver, its voltage is probably weaker or with the noise signal. In consideration of this circumstance minimum at the receiver should be lower than the voltage at the driver.An input higher than +3V on the RD are a Logic0, or on a control input is open. An input lower than -3V on the RD are a Logic1, or on a control input is off. According to this standard, input logic electrical level between -3V and +3V have no definitionNoise tolerable limitation or voltage tolerable limitation is difference output voltage and input voltage. The big voltage undulation from RS-232 lead to a noise tolerable limitation wider than logic5TTL. For example, even thought a output from RS-232 driver is the smallest +5V,its also be weaken in the receiver or the noise peak rise to 2V, and still is a effective Logic0.Many outputs from RS-232 have the wider voltage undulation : 9V and 12V are very common affairs. All these affairs can lead to a noise limitation. The biggest permitting voltage undulation is 15V, even though the receive must have no harm to deal with the voltage higher to 25V.The other two technical terms concern with RS-232 to be used is Mark and Space. Space is Logic0 and Mark is Logic1. These two technical terms which was used by the machine recording instrument to record binary data in many years ago, each of them are representation physical and blank.Clocking Limitation:TIA/EIA-232 including smallest and biggest clocking stipulate. All out the RS-232 interface chips all accord this stipulate.Appointed revolving speed limited the biggest Potter rate of interface.The revolving rate is measure to the rate of speed change when output cut-over voltage, and describe the change of instantaneous velocity in The advantage in limited the revolving is for improve signal quality by in the matter of fact to limited the problem which is due to voltage deflection, voltage deflection occur the signal in the long distance link which has high-speed rise and descend. There more detailed narrations to this problem are in capter10.But revolving velocity also limited to the biggest speed of a link. Under speed of 30V/s, a output need 0.3 s to cut-over time in 166 times.Actually, because the UART to read input data in near the middle of the digit, and also because many times consult clock in very accurate, usually can may use the digit width for cut-over time as short 5 to 10 time safety. Considered these conditions, some interface chips permitting 115kbps or more higher Potter rate, even though its infringe the suggestion this standard.Except for has a biggest cut-over velocity, RS-232 driver also must according the lowest standard to ensure the signal no stopover in the undefined area between the logical condition. To control signal other 40bps and the lower signal. Signal lines must spend time not surpass 1s in the transmit area between the effective Logic1 and Logic0.To other data and time signal this limitation place wide is 4% or under 20 bps is 2s. Frequencies of signal rise and descend also probably close to be equal.Transformation between 5V logical and RS-232Many micro-controllers have asynchronous serial ports, but their input and output rather to use 5V logic than to RS-232 voltage. To link 5V logic to a RS-232 port need to transform into RS-232 electrical level and transform from RS-232 electrical level into 5V logicTo use of 5V logic, I supposed to the use of electrical level of TTL or CMOS logic chips, these chips are supply electricity by a single +5V electrical, signal electrical level refer to grounding electrical level. Tables 6-2 indicate this. I also supposed to positive logic, in here, the logical high electric level is logic1.To TTL logic, a logical low out

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论