How the serial port works

How the serial port works

How the serial port works 9-pin connector 25-pin connector Flow control
How the serial port works

The serial port has always been regarded as one of the most basic external connection devices for computers. It has been an indispensable part of most computers for more than 20 years. Although many newer systems have completely abandoned the serial port after using USB connection devices, most modems are still in use, as are some printers, handheld computers, and digital cameras. However, there are generally no more than two serial ports on the computer.



Two serial ports on the back of the PC

Essentially, the serial port provides standard connectors and protocols, allowing us to connect devices such as modems to computers.

All computer operating systems used by people today support serial ports because they have been "resident" computers for decades. The invention of the parallel port is much later, and the speed is much faster than the serial port. The history of the USB port is only a few years, it is likely to completely replace the serial port and parallel port in the next few years.

The "serial" port is named because this port "serializes" the data. More specifically, it takes one byte of data at a time and transmits the 8 bits of that byte. The advantage of this is that the serial port only needs one line to transmit 8 bits, while the parallel port requires 8 bits. The corresponding disadvantage is that it takes 8 times longer to transfer data than when it has eight lines. In addition, the serial port can also reduce the cost of the cable, making the cable more compact.

Before each byte of data is sent, the serial port sends a start bit, which is a single bit with a value of 0. After sending each byte of data, it will send a stop bit to indicate that the byte has been transferred. In addition, it can send parity bits.

The serial port is also called a communication (COM) port and is a bidirectional port. In two-way communication, each device can receive data and transmit data. Serial devices use different pins to receive and transmit data-if the same pins are used, communication will be limited to half-duplex mode, which means that information can only be propagated in one direction at a time. Using different pins can achieve full-duplex communication. In this mode, information can be propagated in both directions at the same time.


This 40-pin dual in-line package (DIP) chip is a model of the National Semiconductor's NS16550D UART chip.

The serial port relies on a special controller chip universal asynchronous receiver / transmitter (UART) to realize its own functions. The UART chip obtains parallel output from the computer's system bus, and then converts it into a serial form for transmission through the serial port. In order to improve efficiency, most UART chips have a built-in buffer of 16 to 64 kilobytes. Using this buffer, the chip can buffer the data flowing in from the system bus while processing the data to flow to the serial port. Most standard serial ports have a maximum transmission rate of 115Kbps (kilobits per second), and high-speed serial ports such as enhanced serial port (ESP) and super enhanced serial port (Super ESP) can achieve a data transmission rate of 460Kbps .

The external connector for the serial port can be 9-pin or 25-pin. Initially, the main purpose of the serial port was to connect the modem to the computer. The function assignment of the pins reflects this. Next, let's understand in detail what each pin does when connecting the modem.


9 stitches And 25-pin serial connector close-up

9-pin connector

Carrier detection—Determines whether the modem is connected to an available telephone line. Receive data-The computer receives the information sent by the modem. Transmission of data-the computer sends information to the modem. The data terminal is ready-the computer informs the modem that it is ready to talk. Signal ground wire-pin ground. The data set is ready-the modem informs the computer that it is ready to talk. Request to send-The computer asks if the modem can send information. Agree to send-The modem informs the computer that the message can be sent. Ring indicator-After initiating a call, the computer indicates that a signal to detect ringing (sent from the modem) has been received.

25-pin connector:

Unused transmission data-the computer sends information to the modem. Receive data-The computer receives the information sent by the modem. Request to send-The computer asks if the modem can send information. Agree to send-The modem informs the computer that the message can be sent. The data set is ready-the modem informs the computer that it is ready to talk. Signal ground wire-pin ground. Received line signal detector-determines whether the modem is connected to an available telephone line. Unused: Transmit the current loop return value (+) Unused Unused: Transmit current loop data (-) Unused Unused Unused Unused Unused Unused Unused: Receive current loop data (+) Unused data Terminal ready -The computer informs the modem that it is ready to talk. Ring indicator not used-After the call is initiated, the computer indicates that a signal to detect ringing (sent from the modem) has been received. Unused Unused Unused: Receive the current loop return value (-)

The voltage sent through the pin can be in one of two states: on or off. On (binary value "1") indicates that the pin is transmitting signals between -3 and -25 volts, and off (binary value "0") indicates that the pin is transmitting signals between +3 and +25 volts.

Flow control

A very important aspect of serial communication is the concept of flow control. With flow control, one device can notify another device to temporarily stop sending data. Enabling flow control requires the commands "Request to Send" (RTS), "Agree to Send" (CTS), "Data Terminal Ready" (DTR), and "Data Set Ready" (DSR).


Dual serial port card

Let's look at how the flow control works by example: you have a modem that communicates at 56Kbps. The serial connection between the computer and the modem transfers data at 115Kbps, which is more than twice the previous speed. This means that the modem gets more data from the computer than it can transmit over the telephone line. Even if the modem has a 128K buffer to store data, it will quickly run out of buffer space, so that it cannot properly handle all incoming data.

With flow control, the modem can stop the data flow from the computer before it exhausts its own buffer. The computer will continue to send signals on the "Request to Send" pin while checking the signal on the "Agree to Send" pin. If there is no "agree to send" response, the computer stops sending data until it receives the "agree to send" signal before it resumes sending. This will enable the modem to maintain a smooth flow of data.

Motorola antenna

Guangzhou Etmy Technology Co., Ltd. , https://www.gzdigitaltalkie.com