An In-Depth Understanding of the RS-232 Serial Port

Jul 31, 2026 Leave a message

"Serial port" is short for serial communication interface. "Serial communication" refers to a method of communication in which data is transmitted bit by bit in sequence. Common serial ports include RS-232 and RS-485. Although serial communication was developed quite some time ago, it remains widely used in today's industrial automation and control fields. In this article, we'll take an in-depth look at the RS-232 serial port. This article covers the following topics:
1. The History of RS232

2. The RS232 Interface

3. Electrical Signals in RS232

4. Level-Shifting ICs for RS232

5. Data Transmission in RS232

info-615-381

 

1. The History of RS232


RS232 is a communication standard published by the Electronic Industries Association (EIA) in 1962. Its full name is: "Standard for Electrical and Mechanical Interfaces Between DTE and DCE." "DTE" stands for "Data Terminal Equipment," such as a computer; "DCE" stands for "Data Circuit-terminating Equipment." It is also sometimes written as "Data Communication Equipment," such as a modem. The "RS" in "RS232" stands for "Recommended Standard." "232" is the identifier. The early RS-232 standard was developed to enable communication between computers, programmable telephones, and modems; after several revisions, it became a general-purpose serial communication standard. The revisions to RS-232 are as follows:


1969 Version C (RS-232-C);

1986 Version D (RS-232-D);

Version E (RS232-E) in 1991;

Version F (RS232-F) in 1997;


Currently, in the field of industrial automation, RS232 is primarily used for communication between devices such as touchscreens, card readers, barcode scanners, and printers and PLCs.

 

info-1097-556

2. RS-232 Interface


Prior to the F version, RS-232 used a 25-pin serial interface, which came in two types: male and female. The male connector is used for DTE devices, and the female connector is used for DCE devices, as shown in the figure below

 

The physical unit is shown in the figure below:

See the table below for the pin definitions:

 

:

Number Name Abbreviation
1 Shield  
2 Transmitted Data TxD
3 Received Data RxD
4 Request To Send RTS
5 Clear To Send CTS
6 DCE Ready/Data Set Ready DSR
7 Signal ground/common return SG
8 Received line signal detector  
9 Reserved for data set testing  
10 Reserved for data set testing  
11 Unassigned  
12 Secondary received line signal detector  
13 Secondary Clear To Send (S)CTS
14 Secondary Transmitted Data (S)TxD
15 Transmission signal element timing  
16 Secondary Received Data (S)RxD
17 Receiver Signal Element Timing(DCE)  
18 Local Loopback  
19 Secondary Request To Send (S)RTS
20 DTE Ready/Data Terminal Ready DTR
21 Remote Loopback/
Signal Quality Detector
 
22 Ring Indicator RI
23 Data Signal Rate Selector  
24 Transmit signal element timing (DTE)  
25 Test Mode  

 

The 25-pin serial port has too many pins, making it cumbersome to use. To simplify the RS232 serial port, the F version defines a 9-pin serial port, which also includes both a male connector (for DTE) and a female connector (for DCE), as shown in the figure below:

info-455-248

 

 

 See the table below for pin definitions:

 

Number Name Abbreviation
1 Data Carrier Detect DCD
2 Received Data RxD
3 Transmitted Data TxD
4 Data Terminal Ready DTR
5 Ground GND
6 Data Set Ready DSR
7 Request To Send RTS
8 Clear To Send CTS
9 Ring Indicator RI

 

info-1026-622

A PLC is considered a DTE device, and its RS-232 serial port is a male connector. For example, the CM1241 RS-232 serial module for the S7-1200 has a male serial port, as shown in the figure below:

For communication between a DTE and a DTC, a direct connection can be used, as shown in the figure below:

 

For communication between two DTEs (such as a PLC and a barcode scanner), a cross-connection should be used. All pins can be connected to each other, as shown in the figure below:

info-1029-553

 

You can use a minimal connection method, using only three wires to connect the TxD and RxD pins of both devices and ground them together, as shown in the figure below:

This type of connection, in which the DTE connects directly to the DCE without going through the DCE, is also known as a "null modem" connection, and the cable used for this type of connection is called a "null modem" cable or a crossover cable.

info-1013-469

 

3. RS-232 Electrical Signals


The electrical signals at the RS-232 transmit and receive terminals are voltage signals relative to the common ground (GND). A voltage difference between +3V and +15V represents a logical "0"; a voltage difference between -3V and -15V represents a logical "1"; and a voltage difference between -3V and +3V is undefined. 3 V is the minimum detectable voltage signal. In practical applications, the absolute value of the voltage difference is expected to range from 5 V to 15 V. That is, when transmitting data, the transmitter driver outputs a positive voltage signal of +5 V to +15 V to represent a logical "0," while a negative voltage signal of -5 V to -15 V represents a logical "1." When receiving data, any electrical signal greater than 3 V is considered a valid signal.


4. RS-232 Level Conversion ICs


Since microcontroller pins output TTL levels, a dedicated conversion IC (such as TI's MAX3232 or ST's ST3232) is required to convert them to RS-232 levels. For more details, please refer to my previous article: What Is the Difference Between RS-232 and TTL Levels? How Are They Converted?

 

info-670-385

5. RS-232 Data Transmission


The first concept involved in data transmission is baud rate. As we know, serial communication transmits data one bit at a time, with the unit of transmission being the bit. Therefore, the baud rate is defined as the number of bits transmitted per unit of time. The internationally accepted unit of time is the second (s), so the unit of baud rate is bit/s (b/s), also written as bps (bits per second).

There is a specific range of baud rates (not arbitrary values); common baud rates include 9,600, 38,400, 56,000, and 115,200. There are many other values as well; the communicating parties simply need to agree on the same baud rate.

RS-232 is a point-to-point communication protocol. Its data frame consists of four parts: the start bit, data bits, parity bit, and stop bit.

Start bit: Length 1, data value equals logical 0, indicating the start of data transmission;

Data bits: Length 8 or 7, representing the actual data being transmitted;

Parity bit: Length 0 (no parity) or 1 (odd or even parity);

Stop bit: Length 1, 1.5, or 2; the data value is a logical 1, indicating the end of the data frame;

Assuming an RS232 communication is configured with 7 data bits, odd parity, and 2 stop bits, the frame and logical values are shown in the figure below

 

Next, let's do a calculation.


Suppose an RS-232 communication setup has a baud rate of 9,600, 8 data bits, no parity (0), and 1 stop bit. How many bytes of data can be transmitted per second under these communication parameters?


Answer: Based on the parameters, the frame length for this communication is 1 + 8 + 1 = 10 bits. One byte (8 bits) is transmitted within this frame. Therefore, at a baud rate of 9600, the maximum amount of actual data that can be transmitted per second is 9600 / 10 = 960 bytes.

Send Inquiry

whatsapp

Phone

E-mail

Inquiry