Technology Space

What is RS232?


RS-232 standard interface (also known as EIARS-232) is one of the commonly used serial communication interface standards, it is by the American Electronic Industry Association (ElectronicIndustryAssociation, EIA) in conjunction with Bell Systems, modem manufacturers and computer terminal manufacturers in 1970 jointly developed, its full name is "data terminal equipment (DTE) and data communications equipment (DCE) between the serial binary data exchange interface technology standards".

Chinese name: asynchronous transmission standard interface

Foreign Name: RS-232

Type: (DB-9) and (DB-25)

Designated organizations: EIA, etc.

 

I. Introduction

The RS-232-C interface (also known as EIARS-232-C) is one of the most commonly used serial communication interfaces today. (The "-C" in "RS-232-C" is simply a version of RS-232, so it is the same as the "RS-232" abbreviation). It was developed in 1970 by the Electronic Industries Association of America (EIA) in conjunction with Bell Systems, modem manufacturers and computer terminal manufacturers as a standard for serial communications. Its full name is "Data Terminal Equipment (DTE) and Data Communication Equipment (DCE) between the serial binary data exchange interface technology standards" The standard provides for a 25-pin DB-25 connector, the content of the signal on each pin of the connector to be specified, but also the level of the various signals to be specified. Later IBM's PC simplified RS232 to a DB-9 connector, thus becoming the de facto standard. The RS-232 port for industrial control generally uses only three lines, RXD, TXD and GND.

 

II. Features

The RS-232 bus provides for 25 lines and contains two signal channels, the first channel (known as the primary channel) and the second channel (known as the secondary channel). Full-duplex communication can be achieved using the RS-232 bus, usually using the primary channel and less frequently the secondary channel. In general applications, full-duplex communication can be achieved using three to nine signal lines, and a simple full-duplex communication process can be achieved using three signal lines (receive, transmit and signal lines).

Flexible baud rate selection

The standard transmission rates specified for RS-232 are 50b/s, 75b/s, 110b/s, 150b/s, 300b/s, 600b/s, 1200b/s, 2400b/s, 4800b/s, 9600b/s and 19200b/s, allowing flexible adaptation to devices with different rates. For slow peripherals, a lower transfer rate can be selected: conversely, a higher transfer rate can be selected.

Use of negative logic transmission
This electrical standard has been chosen to improve the immunity to interference and to increase the communication distance. The receiver will recognise signals as high as +3V as logic "0" and signals as low as -3V as logic "1".

Longer transmission distances

As RS-232 uses serial transmission and converts the microcomputer's TTL level to RS-232C level, the transmission distance can generally be up to 30 m. If a current loop of 20 mA is used for the transmission, the transmission distance can reach 1000 m. Alternatively, if a Modem is added to the RS-232 bus interface, the transmission distance can be even longer by cable, wireless or optical fibre. The transmission distance can be even longer.

Two physical interfaces

One connector for the RS-232 interface is the 25-pole plug holder D13-25, normally with the plug on the DCE side and the socket on the DTE side.

 

III. Disadvantages

(1) The signal level of the interface is high, which may damage the chip of the interface circuit, and because it is not compatible with the TTL level, a level conversion circuit is needed to connect with the TTL circuit.

(2) The transmission rate is low, in asynchronous transmission, the baud rate is 20Kbps; therefore, in the CPLD development board, the comprehensive program baud rate can only be used 19200, also for this reason.

(3) interface using a signal line and a signal return line and constitute a common ground form of transmission, this common ground transmission is prone to common mode interference, so the resistance to noise interference is weak.

(4) Limited transmission distance, the maximum transmission distance standard value of 50 feet, in fact, can only be used in about 15 meters.

 

IV. Communication Mechanisms

The following is an illustration of the RS-232 serial communication principle using the communication process between a computer and a modem. Consider the interaction between the RS-232 signals and the working process between the computer and the modem when the modem is in answer mode. Assume that the modem is full duplex and operates with the RS-232 standard specification.

(1) In the initial state, RTS and CTS are continuously ON, and the RS232 lead status is set and monitored by the communication program. In the answer mode, the software in the computer keeps monitoring the ringing indication (RI) and waits for the RI to signal ON.

(2) After receiving the RI signal, the communication program on the computer starts counting the ringing by the number of ringing indicator ON/OFF transitions. When the number of ringing is set by the program, the communication program generates a data terminal ready (DTR) signal, forcing the modem to enter the off-hook state.

(3) After waiting 2s (as specified by the FCC), the modem automatically starts sending its answer carrier. At this point the modem sends a modem ready (DSR) signal to inform the computer that it has completed all preparations and is waiting for the carrier signal.

(4) During the continuous DTR signal, the computer software monitors the DSR signal. When the DSR signal turns ON, the computer knows that the modem is ready for the data link connection and the computer immediately starts monitoring the data carrier monitoring (CD) signal to confirm the presence of the data link.

(5) When the carrier from the source modem appears on the telephone line, the answering modem sends a CD signal.

(6) Full duplex communication begins via the transmit data line (TD) and the receive data line (RD). During data link transmission, the computer ensures the presence of the data link by monitoring the CD.

(7) Once the communication task is complete, the computer disables DTR and the modem responds by removing its carrier tone, disabling CD and DSR. As the link is removed, the modem returns to its initial state.

The RS-232 serial communication distance is close (<12m), you can use a cable to connect directly to the standard RS232 port, if the distance is longer you need to attach a modem (Mode), the simplest and commonly used is a three-wire connection, that is, ground, receive data, send data three pins connected.

 

V. Characteristics

The RS232 standard uses an interface with either a 9 or 25 pin D-type plug, commonly used is usually a 9 pin plug.

The RS232C standard interface has 25 wires, only 9 are commonly used, they are:

(1) Received Line Signal Detection (ReceivedLineSignalDetection, RSD) - used to indicate that the DCE has been connected to the communication link, informing the DTE that it is ready to receive data. When the local MODEM receives a carrier signal from the MODEM at the other end of the communication link (remote), the RLSD signal is activated to inform the terminal that it is ready to receive, and the MODEM demodulates the received carrier signal into digital data and sends it to the terminal along the RXD receive data line. This line is also called the data carrier detection (DataCarrierdetection, DCD) line.

(2) Received data (Receiveddata, RXD) - The serial data (DCE → DTE) from the MODEM is received at the terminal via the RXD line.

(3) Transmitted data (Transmitteddata, TXD) - Serial data is sent to the MODEM via the TXD terminal (DTE→DCE).

(4) DataTerminalReady (DTR) - The status when valid (ON) indicates that the data terminal is ready for use.

(5) Ground - GND.

(6) DataSetready (DSR) - When valid (ON) state, indicates that the communication device is in a state ready for use.

(7) Request to Send (RequesttoSend) - used to indicate that the DTE requests the DCE to send data, i.e. when the terminal wants to send data, it makes the signal valid (ON state) and requests the MODEM to send. It is used to control whether the MODEM should enter the send state or not.

(8) Clear to Send (CleartoSend, CTS) - used to indicate that the DCE is ready to receive data from the DTE, is the response signal to the request to send signal RTS. When the MODEM is ready to receive data from the terminal and send it forward, this signal is made valid to notify the terminal to start sending data along the TXD of the transmit data line.

(9) Ringing indication (Ringing, R) - When the MODEM receives a ringing call signal from the exchange, make this signal valid (ON state) to notify the terminal that it has been called.

Electrical characteristics

On TXD and RXD: logic 1 (MARK) = -3 to -15 V; logic 0 (SPACE) = 3 to 15 V. On control lines such as RTS, CTS, DSR, DTR and DCD: signal valid (ON, ON state, positive voltage) = 3 to 15 V; signal invalid (OFF, OFF state, negative voltage) = -3 to -15 V.

The above provisions illustrate the definition of logic levels in the RS232C standard. For data (information code), the level of logic 1 (pass signal) is below -3V and the level of logic 0 (null) is above +3V; for control signals, the ON state (ON) i.e. signal valid level is above 3V and the OFF state (OFF) i.e. signal invalid level is below -3V, i.e. when the absolute value of the transmission level is greater than 3V, the circuit can effectively check out that between -3~3V voltage is meaningless, below -15V or above 15V is also considered meaningless, therefore, the actual work, should ensure that the level in ± (3 ~ 15) V with RS232 bus connection system there are two types of communication methods: proximity communication is the transmission distance of less than 15m communication, can be directly connected with RS232 cable; 15m or more long distance communication, need to modulation mediator is used.

 

VI. Comparisons

RS-232 and USB are both serial communications, but they are completely different in terms of underlying signals, level definitions, mechanical connection methods, data formats, communication protocols, etc. RS-232 is a popular interface. In MS-DOS, the four serial interfaces are called COM1, COM2, COM3 and COM4, while the vast majority of windows applications can have up to four peripherals, but if the user wants to expand more peripherals, this has to be achieved with a plug-in serial card or an external switch box. RS-232 is a point-to-point connection, where only one peripheral can be connected to a serial port.
The basic part of the USB interface is the serial interface engine SIE, which receives data bits from the USB transceiver and converts them into valid bytes for transmission to the SIE interface; conversely, the SIE interface can also receive bytes converted into serial bits for delivery to the bus. As the maximum rate of a PC serial port is only 115.2kbps, a speed bottleneck can form. RS-232 systems consist of 2 serial signal paths in opposite directions for the transmission of commands and data, which must be interleaved with the data; whereas USB supports separate command and data channels and allows independent status reporting. USB is a convenient, flexible, simple and high-speed bus architecture, with the following main features compared to the traditional RS-232 interface.

(1) USB uses a single form of connector and connection cable to achieve a single common interface for data. a unified 4-pin plug for USB replaces the wide variety of serial/parallel plugs behind the PC case and realises the desire to unify conventional I/O devices for computers, multimedia devices (in part), communication devices (phones, networks) and household appliances into one interface.

(2) USB uses an easily expandable tree structure, which can be extended by using the USBHub to connect up to 127 peripherals. USB dispenses with all system resource requirements and avoids the problem of port conflicts when installing hardware, freeing up hardware resources for other devices.
(3) USB peripherals can be set up automatically and support plug-and-play and hot-swapping.

(4) Flexible power supply. USB cable has the function of transmitting power, supports energy saving mode, low power consumption. USB bus can provide voltage +5v, maximum current 2A power supply for low power consumption devices as power supply, no additional power supply is needed.

(5) USB can support four modes of transmission: control transmission, synchronous transmission, interrupt transmission, bulk transmission, can be applied to many types of peripherals.

(6)Fast communication speed.USB supports three bus speeds, low speed 1.5Mbps, full speed 12Mbps and high speed 480Mbps.

(7) Reliability of data transmission. USB uses differential transmission and has error detection and error correction functions to ensure correct data transmission.

(8) Low cost. USB simplifies the method of connecting and configuring peripherals, effectively reducing the overall cost of the system, and is an inexpensive, simple and practical solution with a high performance-to-price ratio.

RS-232 is widely available, inexpensive, easy to program and can use longer wires than other interfaces, and as USB ports become more common, more conversion devices will be available to convert RS-232 or other interfaces to USB. However, RS-232 and similar interfaces will still be commonly used in applications such as monitoring and control systems. Developers and products accustomed to using RS-232 can consider designing USB/RS-232 converters that transfer RS-232 data over the USB bus, i.e. the application software on the PC is still programmed for the RS-232 serial port and the peripheral devices use RS-232 as the data communication channel, but the physical connection from the PC to the peripheral devices is the USB bus and the data communication on it is also in the USB data format. data communication is also in USB data format. The advantages of this approach are: on the one hand, it protects the original investment in software development, and the application software that has been successfully developed for RS-232 peripherals can continue to be used without modification; on the other hand, it makes full use of the advantages of the USB bus, which allows more RS-232 devices to be connected via the USB interface, not only to obtain higher transmission speeds and realise true plug-and-play, but also to solve the USB interface can not be long-distance transmission shortcomings (USB communication distance within 5 meters).

 

*Note: The above content is from the network, only for learning and exchange, if there is any infringement, please contact to delete.

 

More Related Programs