当前位置:首页 >> 信息与通信 >>

EIA-RS-232C Interface


bvcTechweb.com

10/16/2002

EIA RS-232 INTERFACE
RS-232 is an unbalanced digital serial data interface that uses a single ground return line as a reference for all ot

her signals used on the interface connector. Originally RS-232 was defined using a DB25 style connector. In order for a device to be compliant with RS-232 the device must be designed to send and receive signals from +/- 3 volts to +/- 25 volts. The device must also be able to transmit data at least 50 feet at a rate of 9600 baud. There are two valid signal states for an RS-232 signal. Mark which is considered a negative voltage potential, and represents a binary or logic "1" state; and Space, which is considered a positive voltage potential and represents a binary or logic "0" state. The following is a definition of the pin assignments on a DB25 connector that represents a DTE. For the rest of this discussion we will not refer to pins 9, 10, 11, 12, 13, 14, 16, 18, 19, 21, 23, and 25 because these pin assignments are rarely ever used. Be aware that they exist in the event you hear about them. The secondary signal's function is the same as their primary signal pins.

Let’s define the remaining pins. These definitions are with respect to the above DB25 connector; however in this day and age of technology you may find RS232 on many other styles of connectors. As a manufacturer designs a piece of equipment, it will be the responsibility of that manufacturer to provide the buyer with a definition of the pin assignments, the signal names, and if necessary the

10/16/2002

1

bvcTechweb.com direction of the signal flow with respect to that device.

10/16/2002

PIN #1: This pin is considered Frame Ground. Frame Ground is connected to the equipment chassis which makes connection to the electrical ground wire in the AC power outlet. You will also hear this signal referred to as Protective or Chassis ground. PIN #2: Transmit Data. This is the output or sending data path for DTE. PIN #3: Receive Data. This is input or receiving data path for DTE. PIN #4: Request to Send. This pin is also commonly referred to as RTS. RTS is a hardware control signal that DTE devices can use to indicate their desire to send some data. Whether this signal is actually used will depend on the equipment manufacturer. PIN #5: Clear to Send. This pin is also commonly referred to as CTS. CTS is a hardware control signal that DCE devices can use to indicate that it is OK for the requesting device to send its data. PIN #6: Data Set Ready. This pin is also commonly referred to as DSR. DSR is a hardware control signal that indicates that the data set is ready. A data set is usually considered to be a modem or modem type device usually installed to extend the RS-232 interface beyond its normal communications maximum distance. PIN #7: Signal Ground. This is a non-directional signal. Signal Ground is used as a reference point for all other signals. PIN #8: Data Carrier Detect. This pin is also commonly referred to as DCD or CD or RSCD. DCD is a hardware control signal typically used by a modem or modem type device to indicate that a communications path is established to another modem and that the path is ready to use. PIN #15: Transmit Clock. Used as a timing signal typically from a modem or modem device so that the end devices will be transmitting data at the same speed. Clock signals are exclusively used by synchronous devices. PIN #17: Receive Clock. Used as a timing signal typically from a modem or modem device so that the end devices will be receiving data at the same speed. Clock signals are exclusively used by synchronous devices. PIN #20: Data Terminal Detect. Also commonly referred to as DTR. DTR is a hardware control signal that indicates that the attached DTE device is ready. PIN #22: Ring Indicator. Also commonly referred to as RI. RI is a signal that is exclusively used by an analog modem to let the attached terminal device know that the phone line is ringing. PIN #24: Terminal Timing. This is a clock signal generated by a synchronous terminal type device. Typically this signal is tail-circuit configurations, when two DCE devices must be connected. One of the DCE devices must be set to accept ‘External Clock.’ Now that we have definitions for all of the commonly used signals, lets define some device types. There are basically two types of device connections for serial communications. These definitions are not only used for RS-232, however for the

10/16/2002

2

bvcTechweb.com

10/16/2002

purpose of this discussion we will keep RS-232 as the interface being described. DTE: This term is an acronym for DATA TERMINAL EQUIPMENT. A DTE device is considered to be any terminal type device that is generating the data to be sent. DTE devices include devices such as dumb terminals, PC's, serial printers, and mainframe ports. Figure #1 contains a general signal layout of a DTE device. Keep in mind this is general; and may only include some of the signals. It will be up to the equipment manufacturer to list in their documentation the type of connector, and the pin assignments they used. As long as the connector being used is a DB25, regardless of gender, figure #1 can be assumed if the user can't give you any other information.

DCE: This term is an acronym for DATA COMMUNICATIONS EQUIPMENT. A DCE device is a modem or modem type device. A DCE device is something that is used to extend the communications path between two DTE's. DCE devices include modems, line drivers, line sharing devices, and multiplexers. Again, as with a DTE device, the pin assignments in figure #2 are general, and assume a DB25 connector. The actual pins a device will utilize and the type of connector are determined by the device manufacturer and will be specified in their product documentation.

10/16/2002

3

bvcTechweb.com

10/16/2002

If you are not sure whether your equipment is DTE or DCE, then a breakout box is handy; you can use it to determine the connection. A breakout box is something that will allow you to see which signals are active by the LED's on the breakout box. When you plug the breakout box by itself into a device port, the active data lead will light either pin 2 or pin 3 of the breakout box. If pin 2 lights, the device is DTE. If pin 3 lights, the device is DCE. For this to be correct, you MUST plug directly to the device connector. Let us now concentrate on asynchronous or more commonly referred to as async communications. If a device is async then there will be no clock signals to time the data. Data speed is selected by what is called the Baud Rate. Baud Rate is the speed that two communicating devices will run. Both devices must be set for the same Baud Rate. In order for the receiving device to know that a character is being sent, a Start Bit must precede the character. Characters are typically represented by 8 bits (binay digits); but can be 7 or 9. The following bit, if used, will be a parity bit. The parity bit is used for error checking so that a receiving device will know that it received the correct character. The various settings for parity are Even, Odd, Mark, Space, and None. No setting is better than the other. The idea is that the settings for both devices that need to communicate with each other must be set the same. The end of a character or word in serial communications is determined by 1 or 2 stop bits. These bits are a non-standard bit length by electrical representation; and all units must be set the same. The Start Bit, Data Bits, Parity Bit, and the Stop Bit make up what is called an ASCII character. ASCII (pronounced as'-key) stands for American Standard Code for Information 10/16/2002 4

bvcTechweb.com

10/16/2002

Interchange. Basically ASCII is a type of coding method that represents our basic numbers and letters. Both communicating devices must be able to speak the same language to communicate. From this point on we will consider every device communicating using ASCII. Keeping in mind our basic DTE/DCE device model from figures 1 and 2, and recognizing that pins 15, 17, and 24 have no function in an async application, and will not be supported by the connected equipment. We will also assume a DB25 connector for every device connection. If the device connections are the same such as both devices being DTE and DCE then a Null Modem or Cross Pinned cable must be used. The terms Null Modem and Cross Pinned are used interchangeably. There are several ways in which a null modem cable can be pinned. See figures #3, and #4 for a basic DTE or DCE pin assignment charts. Null Modem cables can be pinned in many different configurations, and there is no one way that is standard. Null modem cables are typically specific to the devices in the application and should be built based on the active leads each particular device in the application have to support in order to communicate properly.

10/16/2002

5

bvcTechweb.com

10/16/2002

RTS, CTS, DSR, DCD, and DTR are considered control signals. Control signals are signals that define the state of a device as ready or busy. Of these five listed control signals, any or all of them may be used. Exactly which ones will be used will be determined by the manufacturer that makes a particular device. When control signals are used to control the flow of data from device to device this is called Hardware Flow Control. The name comes from the fact that these signals are physically presented by the device on the RS-232 connector, and are connected through the cable from device to device. The idea is to connect the output control signal from one device to the input control signal of the other device. When connecting two devices together the flow control settings MUST be the same. As an example lets say we want to connect a mainframe serial port to a serial printer. We know that both of these devices are typically considered DTE devices. The user manual for the mainframe lists the following signals as being active. Mainframe: Pin 1: Chassis Ground Pin2: Transmit Data Pin3: Receive Data Pin5: Clear to Send (CTS) (Input Control Signal) Pin20: Data Terminal Ready (DTR) (Output Control Signal) Printer: Pin1: Chassis Ground Pin2: Transmit Data Pin3: Receive Data Pin6: Data Set Ready (DSR) (Input Control Signal) Pin20: Data Terminal Ready (DTR) (Output Control Signal)

10/16/2002

6

bvcTechweb.com

10/16/2002

If we were to construct a cable so that the mainframe could communicate with the printer, and also support hardware flow control, the cable would look as follows:

The basic idea for any cable configuration is to connect transmit data to receive data, and to connect any output control signal to an input control signal. Another method of controlling the flow of data is called X-ON and X-OFF, or software flow comtrol. This is a character sequence that is transmitted across the data pins in a cable as part of the normal data transfer that is taking place between two communicating devices. X-OFF is the character that tells the sending device to STOP transmitting. When the receiving device is ready to receive more data then that device will send the X-ON character telling the sending device it is OK to continue. When connecting two devices together, the flow control settings must be the same. When you are connecting unlike devices ( one device being DTE, the other being DCE ) a straight-pinned or modem cable is used. Straight and modem are also interchangeable terms. As the name implies a straight pinned cable has a pin for pin connection from cable connector to cable connector. As an example, let’s say a user wants to connect their PC serial port to an async dial-up modem for access to the Internet. The PC we are using has a DB25 male connector for its serial port and the modem has a DB25 female connector. A PC is considered a DTE device and will support the following leads: 1 2 3 4 5 6 7 8 20 22 Frame Ground Transmit Data Receive Data Request to Send (RTS) (Output Control Lead) Clear to Send (CTS) (Input Control Lead) Data Set Ready (DSR) Input Control Lead) Signal Ground Data Carrier Detect (DCD) (Input Control Lead) Data Terminal Ready (DTR) (Output Control Lead) Ring Indicator (RI) (Input signal from a modem only. Used to indicate the phone ringing)

10/16/2002

7

bvcTechweb.com

10/16/2002

A modem is considered a DCE device and will support the following leads: 1 2 3 4 5 6 7 8 20 22 Frame Ground Receive Data Transmit Data Request to Send (RTS) (Input Control Signal) Clear to Send (CTS) (Output Control Signal) Data Set Ready (DSR) (Output Control Signal) Signal Ground Data Carrier Detect (DCD) (Output Control Signal) Data Terminal Ready (DTR) (Input Control Signal) Ring Indicator (RI) (Output signal from a modem only. Used to indicate to the attached DTE that the phone line is ringing)

The cable connection for this application would be as follows: PC: 1 2 3 4 5 6 7 8 20 22 Modem: 1 2 3 4 5 6 7 8 20 22

Up to this point, we have only discussed RS-232 utilizing a DB25 connector. There is also another standard called EIA-574. This standard defines RS-232 on a DB9 connector. This standard is not often followed except in the PC world. Most of today's PC's will have a DB9 male connector for their serial port. Keep in mind that not all devices in the world using a DB9 connector will support the EIA574 standard.

The following are the pin assignments for the EIA-574 standard are as follows:

10/16/2002

8

bvcTechweb.com

10/16/2002

Since we know that a PC is a DTE device, the input/output signals still follow the same designations as in figure #1, however now the signals are on different pins. Understanding the basic concept of DTE vs. DCE will help you in most applications, however if there is any doubt, always consult the documentation for a given product to determine which signals are outputs and which are inputs. A basic PC to DCE device cable pin-out if the PC has a DB9 male serial port, and the DCE is DB25, is as follows: PC: 1 2 3 4 5 6 7 8 9 DCE: 8 3 2 20 7 6 4 5 22

The above configuration is considered a straight through cable. A basic PC to DTE device cable pin-out as with any null modem is not so defined and will vary from application to application, however a general pinning is as follows: PC: 1,6 2 3 4 5 7 8 DTE: 20 2 3 6,8 7 5 4

10/16/2002

9

bvcTechweb.com

10/16/2002

While we are on the subject of a PC, All PC's will have either a DB25 or DB9 MALE connector for a standard from the factory serial communications port, and a DB25 FEMALE connector for the parallel printer port. If a user has any other connector arrangement then they have a third party expansion card in their computer and the user will have to be able to supply you with the pin assignments for that particular third party port in order for you to help with any cable connections the user needs. A Up to this point we have discussed RS-232 async communications. Let’s now have a brief discussion about RS-232 synchronous communications. With RS232 async communications, we used start and stop bits to keep our data together so that the receiving device could tell when the beginning and end of a character took place. In RS-232 synchronous communications data is typically sent in a block format which may be comprised of many characters. It is typically the responsibility of the DCE device to keep all of the data in the block in sync for the end DTE's by using a clock signal for timing. A DCE will provide clock on pins 15 and 17 of the DB25 for this purpose. In async data the start and stop bits were used for each character sent. In sync data, there will be a sync character along with a start of text or start of header character that is first sent to the receiving device to start the timing process then a block of characters will be sent followed by and end of text or end of transmission character to signify the end of the data block. All of this data is kept in time with the clock source. As far as what the sync, start of text, and end of block characters will actually be will depend on the protocol that the communicating devices will use. The protocol is nothing more than a language the devices use such as ASCII that we discussed previously. When running synchronous transmission, there should only be one master clock source that provides the timing. All other DCE's and DTE's should slave from the master clock. DTE's have a pin designated under the RS-232 specification for providing clock. The pin number is 24, however, this pin is rarely used. TIMING: This should be used as an aid in understanding the communications that occur between a DTE (Data Terminal Equipment) device and DCE (Data Communications Equipment) device. When the word "timing" arises, one should think of the process by which data travels from origin to destination. In the majority of networks, the DCE is responsible for supplying information to the DTE with the clock it provides on the Receive Clock lead. The DCE will accept information from the DTE with the clock it provides on the Transmit Clock lead. There are special circumstances that arise when a DTE requires a DCE to accept information which was generated with DTE provided clocking on the Transmit Clock External lead. Another important aspect to remember about these two pieces of equipment is the Input/Output relationship that is unique to each device. There are several illustrations which follow to help clarify this relationship. In a Data Communications environment, "timing" and "clocking" are synonymous and refer to the means by which data travels throughout a network. The figure 10/16/2002 10

bvcTechweb.com

10/16/2002

below, a DTE/DCE connection is shown. The data/clock leads are labeled along With the I/O relationship. By understanding the I/O characteristics, the mystery behind the need for cross-over (null modem, rollover, reversal) cable vanishes.

The figure below shows a typical DCE/DCE connection and the data/clock map for a crossover cable.

The next step is to show a generic DTE/DCE network and illustrate the path that the clock and data trace throughout this closed loop. The figure below depicts such a network. There is basically only one way to "time" this network and that is to have one modem operate as the master (internal) and the other modem as a slave (loop). Even though it is true that the DTE could provide a transmit clock (TCE) to the attached DCE, the configuration shown is most commonly used. NOTE: In most applications, this is the timing scheme used.

10/16/2002

11

bvcTechweb.com

10/16/2002

PLL- PHASE LOCK LOOP (derives Receive Clock from Receive Data) Shown in the figure below, are several modem (DCE) devices placed in succession and the timing arrangement to make the system operate. It is necessary to make use of a crossover cable to assure the I/O relationship which was stated earlier. Also provided are several rules regarding the timing of a modem.

NOTE: Classifications of timing modes are relative to a modem (DCE). INTERNAL: Resident oscillator on modem provides transmit clock. EXTERNAL: Modem clocks data into itself using the clock off the digital interface [RS-232 - Transmit Clock External (TCE) lead, RS-449 Terminal Timing (TT) lead, V.35 - Serial Transmit Clock External (SCTE)]. LOOP: Modem clocks data into itself using the clock derived from the line (2 or 4 wire). Receive Clock is looped to Transmit Clock.

10/16/2002

12


相关文章:
rs-232简介
这里只介绍 EIA RS-232C(简称232,RS232) 。例如,目前 在 IBM PC 机上的 COM1、COM2接口,就是 RS-232C 接口。 电气特性 EIA-RS-232C 对电气特性、逻辑...
RS-232C的介绍
RS-232C 是你的计算机用来与你的 modem 及其它串行设备交谈或交换数据的接口。...RS-232C详解 暂无评价 22页 免费 EIA-RS-232C Interface 12页 免费 关于RS...
RS232串口信号
一、RS-232-C RS-232C 标准(协议)的全称是 EIA-RS-232C 标准,其中 EIA(Electronic Industry As sociation)代表美国电子工业协会,RS(ecommeded standard)代表...
串口通讯-RS232C详解
这里只介绍 EIA�RS-232-C(简称 232,RS232)。 例如,目前在 IBM PC 机上的 COM1、COM2 接口,就是 RS-232C 接口。 1.电气特性 EIA-RS-232C 对...
RS-232C详解
这里只介绍 EIA�RS-232-C(简称 232,RS232)。 例如,目前在 IBM PC 机上的 COM1、COM2 界面,就是 RS-232C 界面。 1.电气特性 EIA-RS-232C 对...
EIA标准详解 RS-232-C 详解
EIA RS-232C 与 TTL 转换: RS-232C 是用正负电压来表示逻辑状态, EIA 与...EIA-RS-232C Interface 12页 免费 EIA 232标准 18页 1下载券©...
RS-232简介
这里只介绍 EIA RS-232C (简称 232, RS232) 。 例如, 目前在 IBM PC 机上的 COM1、 COM2 接口,就是 RS-232C 接口。 电气特性: EIA-RS-232C 对...
RS-232串口的线序
PC 机出现后,已有的串口设备成为 PC 机外设,自然采用 RS232 标准。目前 PC 机的串行通信接口采用 EIA-RS-232C 标准, C 代表 1969 年最新一次 的修改。 EIA...
RS232规范
RS-232-C 接口(又称 EIA RS-232-C)是目前最 常用的一种串行通讯接口。它是在 1970 年由美国电子工业协会(EIA)联合贝尔系统、 调制解调器厂家及计算机终端生...
RS232通讯协议
一般的通讯协议只符合 OSI 七层模型的某几层,如: EIA-RS-232-C:实现了物理层。 IBM 的 SDLC(同 步数据链路控制规程):数据链路层。ANSI 的 ADCCP(先进数据...
更多相关标签:
eiars232c标准 中文版 | eia rs232c | rs 232 interface | rs232c | c rs232串口通讯 | rs 232c跟rs 232区别 | rs232c串口接线图 | rs232和rs232c |