Serial communication interface standards

RS232 interface is the serial port, the 9-prong socket on the back of the computer chassis, next to the general "|O|O|" kind of logo.

The average chassis has two, new chassis may have only one. Laptops may not have one.

There are many industrial instruments that use it as a standard communication port. The content and format of the communication is usually attached to the user manual of the instrument.

The transfer of data between a computer and a computer or a computer and a terminal can be done in both serial and parallel communication. Because the serial communication method has the use of less lines, low cost, especially in the remote transmission, to avoid the inconsistency of the characteristics of multiple lines and is widely used. In serial communication, both sides are required to use a standard interface, so that different devices can be easily connected for communication. The RS-232-C interface (also known as EIA RS-232-C) is one of the most commonly used serial communication interfaces. It was developed in 1970 by the Electronic Industries Association of America (EIA) in conjunction with the Bell System, modem manufacturers and computer terminal manufacturers **** with the development of standards for serial communications. Its full name is "data terminal equipment (DTE) and data communications equipment (DCE) between the serial binary data exchange interface technology standard" the standard provides for the use of a 25-pin DB25 connector, the connector's signal content of each pin is specified, but also on the various signal levels are specified.

(1) the signal content of the interface In fact, many of the 25 leads of the RS-232-C is rarely used, in the computer and terminal communications generally use only 3-9 leads. RS-232-C most commonly used signal content of the nine leads shown in Exhibit 1

(2) the electrical characteristics of the interface in the RS-232-C in any of the signal line voltage is a negative logical relationship. Voltage are negative logic. That is: logic "1", -5 - 15V; logic "0" +5 - +15V. The receiver is required to recognize signals as low as +3V as logic "0" and signals as high as -3V as logic "1"

(3) Physical structure of the interface The RS-232-C interface connector generally uses a 25mm DB-25 connector. Model DB-25 25-pole plug holder, usually in the DCE end of the plug, socket in the DTE end. Some of the equipment and the PC connected to the RS-232-C interface, because the other side does not use the transmission of control signals, only three interface lines, namely, "send data", "receive data" and "signal ground ". So the DB-9 9-core plug holder is used, and the transmission line is shielded twisted pair.

(4) the transmission cable length by the RS-232C standard in the code element distortion less than 4% of the transmission cable length should be 50 feet, in fact, this 4% of the code element distortion is very conservative, in practice, about 99% of the users are based on the code element distortion of the range of 10-20% of the work, so the actual use of the maximum distance will be well over 50 feet, the U.S. DEC has stipulated that the allowable code distortion of 10% and the results of the experiments in Exhibit 2. The No. 1 cable is shielded cable, model DECP.NO.9107723 There are three pairs of twisted pairs, each pair consists of 22 # AWG, which is covered with a shielded mesh. 2 cable is not shielded cable. Model number DECP.NO.9105856-04 is a four core cable of 22# AWG.

1.RS-232-C is a serial physical interface standard developed by EIA (Electronic Industry Association), RS is an abbreviation for "Recommended Standard", 232 is the identification number, C indicates the number of modifications. RS-232-C bus standard has 25 signal lines, including a main channel and an auxiliary channel, in most cases mainly use the main channel, for general duplex communication, only a few signal lines can be realized, such as a transmitter line, a receiver line and a ground line.RS-232-C standard data transmission rate of 50, 75, 100, 150, 300 per second, 600, 1200, 2400, 4800, 9600, 19200 baud. RS-232-C standard specifies that the driver is allowed to have a capacitive load of 2500pF, and the communication distance will be limited by this capacitance, for example, when using a communication cable of 150pF/m, the maximum communication distance will be 15m; if the capacitance of each meter of cable is reduced, the communication distance can be increased. Another reason for the short transmission distance is that RS-232 is a single-ended signal transmission, there are *** ground noise and can not suppress *** mode interference and other issues, so it is generally used for communication within 20m.

2. RS-485 bus, in the requirements of the communication distance of tens of meters to thousands of meters, widely used RS-485 serial bus standard. RS-485 using balanced transmission and differential reception, and therefore has the ability to inhibit **** mode interference. In addition, the bus transceiver has a high sensitivity and can detect voltages as low as 200mV, so the transmitted signal can be recovered from kilometers away. RS-485 half-duplex mode of operation, at any time there can only be a point in the transmission state, therefore, the transmission circuit must be controlled by the enable signal.RS-485 for multi-point interconnections is very convenient, you can save a lot of signal lines. RS-485 can be networked to form a distributed system, allowing up to 32 drivers and 32 receivers to be connected in parallel.

Previously, PCs communicated with smart devices through RS232, RS485, and Ethernet, depending on the device's interface specification. But RS232, RS485 can only represent the communication of the physical media layer and link layer, if you want to achieve two-way access to data, you must write their own communication applications, but most of this program can not meet the ISO/OSI specifications, can only achieve a single function, applicable to a single type of equipment, the program does not have the generality. In the RS232 or RS485 devices into a network of devices, if the number of devices more than 2, it is necessary to use RS485 as a communication medium, RS485 network equipment to interoperate with the information only through the "main (Master)" device can be realized, the main device is usually a PC, and this device This master device is usually a PC, and this kind of device only allows the existence of a master device in the network, and the rest are all from (Slave) devices. The fieldbus technology is based on ISO/OSI model, with a complete software support system, which can solve the problems of bus control, conflict detection, link maintenance, etc. ...

RS-232C interface standards in detail

Serial communication interface standards have been used and developed, and there are now several. But all of them are formed on the basis of RS-232 standard after improvement. Therefore, RS-232C is the main one to be discussed.RS-323C standard is a communication protocol published in 1969 developed by EIA (Electronic Industries Association) of the United States together with BELL and other companies. It is suitable for communication with data transmission rates in the range of 0 to 20,000b/s. This standard specifies issues related to serial communication interfaces, such as signal line functions and electrical characteristics. Since the pass equipment manufacturers are producing communication equipment compatible with the RS-232C standard, it is now widely used as a standard in microcomputer communication interfaces.

Before discussing the contents of the RS-232C interface standard, two points are stated:

First of all, the RS-232-C standard was initially developed for remote communication connecting the data terminal equipment DTE (Data Terminal Equipment) and the data communication equipment DCE (Data Communication). Equipment) and developed. Therefore, this standard was not developed with the application requirements of computer systems in mind. However, it is now widely borrowed for computers (more accurately, computer interfaces) and terminals or peripherals between the near-end connection standard. Obviously, some of the provisions of this standard and the computer system is inconsistent, or even contradictory. With an understanding of this background, we have the RS-232C standard and computer incompatibility is not difficult to understand.

Second, the RS-232C standard refers to the "transmit" and "receive", are in the position of the DTE, not in the position of the DCE to define. Since in a computer system, it is often the case that information is transmitted between the CPU and the I/O devices, both of which are DTEs, both of which are capable of sending and receiving.

I, RS-232-C

RS-232C standard (protocol) is the full name of the EIA-RS-232C standard, which EIA (Electronic Industry Association) on behalf of the U.S. Electronic Industries Association, RS (ecommed standard) on behalf of the recommended standards. 232 is the identification number, C on behalf of the latest revision of RS232 (1969), before that, there are RS232B, RS232A. It specifies the connecting cables and the mechanical and electrical characteristics, signaling functions and transmission processes. Other commonly used physical standards are EIARS-232-C, EIARS-422-A, EIARS-423A, EIARS-485. Only EIARS-232-C (abbreviated as 232, RS232) is introduced here. For example, the COM1 and COM2 interfaces, which are currently on IBM PCs, are RS-232C interfaces.

1. Electrical Characteristics

EIA-RS-232C on the electrical characteristics, logic levels and various signal line functions are specified.

On TxD and RxD: Logic 1 (MARK) = -3V to -15V

Logic 0 (SPACE) = +3 to +15V

On control lines such as RTS, CTS, DSR, DTR, and DCD:

Signal valid (on, ON state, positive voltage) = +3V to +15V

Invalid signal (disconnected, OFF state, negative voltage) = -3V to -15V

Figure 1

The above provisions illustrate the RS-323C standard's definition of logic levels. For data (information code): the level of logic "1" (pass sign) is lower than -3V, the level of logic "0" (null sign) sues +3V; for control signals; on state (ON) that is, the level of signal valid is higher than +3V, off state ( OFF) that the signal is invalid level below -3V, that is, when the absolute value of the transmission level is greater than 3V, the circuit can be effectively checked out, between -3 ~ +3V between the voltage is meaningless, lower than -15V or higher than the +15V voltage is also considered meaningless, therefore, the actual work, should ensure that the level of ± (3 ~ 15) V between.

EIA-RS-232C and TTL Conversion: EIA-RS-232C uses positive and negative voltages to represent the logic state, which is different from TTL's provision of high and low levels to represent the logic

state. Therefore, in order to be able to connect to a computer interface or terminal TTL device, it is necessary to convert the level and logic relationship between the EIA-RS-232C and TTL circuits. The method of realizing this conversion can be discrete components or integrated circuit chips. Currently more widely used integrated circuit conversion devices, such as MC1488, SN75150 chip to complete the TTL level to EIA level conversion, and MC1489, SN75154 can be realized EIA level to TTL level conversion. MAX232 chip to complete the TTL ← → EIA bidirectional level conversion, Figure 1 shows the 1488 and 1489 of the internal structure and pins. Figure 1 shows the internal structure and pins of the 1488 and 1489. pins (2), (4,5), (9,10) and (12,13) of the MC1488 are connected to the TTL input. Pins 3, 6, 8, and 11 outputs are connected to EIA-RS-232C. pins 1, 4, 10, and 13 of 14 of the MC1498 are connected to the EIA inputs, while pins 3, 6, 8, and 11 are connected to the TTL outputs. The specific connection method is shown in Figure 2. The left side of the figure is the main chip UART in the microcomputer serial interface circuit, which is a TTL device, and the right side is the EIA-RS-232C connector, which requires EIA high voltage. Therefore, all the RS-232C output and input signals have to go through the MC1488 and MC1498 converters, respectively, for level conversion before they can be sent to the connector up or in from the connector.

Figure 2

2,, the mechanical characteristics of the connector:

Connector: Since RS-232C does not define the physical characteristics of the connector, therefore, the emergence of a variety of types of DB-25, DB-15 and DB-9 connectors, and the definition of its pins are different. The following are two kinds of connectors respectively.

(1) DB-25: PC and XT machines use DB-25 type connector. DB-25 connector defines 25 signal lines divided into 4 groups:

① 9 voltage signals for asynchronous communication (including signal ground SG) 2, 3, 4, 5, 6, 7, 8, 20, 22

② 20mA current loop signal 9 (12, 13. 14,15,16,17,19,23,24)

③Empty 6 (9,10,11,18,21,25)

④Protective earth (PE) 1, as the equipment ground terminal (1 pin)

The shape of the DB-25 connector and the distribution of the signal wires are shown in Figure 3. Note that the 20mA current loop signal is provided only for IBM PC and IBM PC/XT machines, and is no longer supported up to AT machines and beyond.

Cable length: The maximum physical distance over which RS-232C can be directly connected is 15m (50 ft.) at communication rates below 20kb/s.

Maximum Direct Transmission Distance Note: The RS-232C standard specifies that the maximum transmission distance between DTE and DCE is 15m (50 feet) if MODEM is not used and if the code element distortion is less than 4%. It can be seen that this maximum distance is given in the code element distortion less than 4% of the premise. To ensure that the code element distortion is less than 4%, the interface standard specifies in the electrical characteristics that the load capacitance of the driver should be less than 2500pF.