Serial Port Communication

Aug 14, 2025

Leave a message

                                                                                  Serial port communication

The concept of Serial Communications is very simple, and the serial port sends and receives bytes bit by bit. Although slower than byte parallel communication, the serial port can receive data using another line while sending data using one line. It is simple and allows for long-distance communication. For example, when IEEE488 defines a parallel pass state, it stipulates that the total length of the equipment line shall not exceed 20 meters, and the length between any two equipment shall not exceed 2 meters; for the serial port, the length can reach 1,200 meters. Typically, the serial port is used for the transmission of ASCII characters. Communication is completed using three lines, namely ground, sending and receiving. Since serial communication is asynchronous, the port can send data on one line while receiving data on another line. Other lines are used for handshakes, but are not required. The most important parameters of serial communication are baud rate, data bit, stop bit and parity. For two ports that communicate, these parameters must match.

Baud rate

This is a parameter that measures the transmission rate of the symbol. It refers to the change of the signal after it is modulated within a unit time, that is, the number of times the carrier parameter changes within a unit time, such as 240 characters are transmitted per second, and each character format contains 10 bits (1 start bit, 1 stop bit, 8 data bits). At this time, the baud rate is 240Bd, and the bit rate is 10 bits * 240/sec = 2400bps. Generally, the modulation rate is greater than the baud rate, such as Manchester encoding). Usually the baud rates of telephone lines are 14400, 28800 and 36600. The baud rate can be much larger than these values, but the baud rate is inversely proportional to the distance. High baud rates are often used for communication between instruments placed very close, and a typical example is communication between GPIB devices.

Data bits

This is a parameter that measures the actual data bits in the communication. When a computer sends a packet, the actual data is often not 8 bits, and the standard values are 6, 7, and 8 bits. How to set it up depends on the information you want to send. For example, the standard ASCII code is 0~127 (7 digits). The extended ASCII code is 0~255 (8 bits). If the data uses simple text (standard ASCII code), then each packet uses 7 bits of data. Each packet refers to a byte, including the start/stop bit, the data bit, and the parity bit. Since the actual data bit depends on the selection of the communication protocol, the term "packet" refers to any communication situation.

Stop position

Used to represent the last bit of a single package. Typical values are 1, 1.5 and 2 bits. Since the data is timed on the transmission line and each device has its own clock, it is likely that a small out-of-synchronization occurs between the two devices in communication. Therefore, the stop bit is not only an end of the transmission, but also provides an opportunity for computer to correct clock synchronization. The more bits are suitable for stop bits, the greater the tolerance for different clock synchronization, but the slower the data transmission rate.

Parity bit

A simple error detection method in serial communication. There are four ways to detect errors: even, odd, high and low. Of course, it is OK to have no check bits. For even and odd verification, the serial port will set the check bit (the bit after the data bit), and use a value to ensure that the transmitted data has even or odd logical high bits. For example, if the data is 011, then for even parity, the check bit is 0, ensuring that the logically high number of bits is an even number. If it is odd check, the check bit is 1, so there are 3 logical highs. High and low do not really check data, simply set logic high or logic low verification. This allows the receiving device to know the status of a bit and have the opportunity to determine whether noise interferes with communication or whether transmission and reception data are out of sync.

RS-232 standard

Serial port communication refers to a communication method in which data is transmitted bit by bit through data signal lines, ground lines, control lines, etc. between peripherals and computers. This communication method uses fewer data lines, which can save communication costs in long-distance communication, but its transmission speed is lower than parallel transmission.

The serial port is a very common device communication protocol on computers. Most computers (not including laptops) contain two RS-232-based serial ports. The serial port is also a common communication protocol for instruments and instruments; many GPIB-compatible devices also have RS-232 ports. At the same time, the serial communication protocol can also be used to acquire data from remote acquisition devices.

RS-232 (ANSI/EIA-232 standard) is a serial connection standard on IBM-PC and its compatible machines. It can be used for many purposes, such as connecting a mouse, printer or modem, and can also connect industrial instruments. For improvements in driving and wiring, the transmission length or speed of RS-232 often exceeds the standard value in practical applications. RS-232 is limited to point-to-point communication between PC serial port and device. The maximum distance for RS-232 serial communication is 50 feet.

Send Inquiry