A serial port is a serial communication interface through which information transfers in or out sequentially one bit at a time. This is in contrast to a parallel port, which communicates multiple bits simultaneously in parallel. Throughout most of the history of personal computers, data has been transferred through serial ports to devices such as modems, terminals, various peripherals, and directly between computers.
While interfaces such as Ethernet, FireWire, and USB also send data as a serial stream, the term serial port usually denotes hardware compliant with RS-232 or a related standard, such as RS-485 or RS-422.
Modern consumer personal computers (PCs) have largely replaced serial ports with higher-speed standards, primarily USB. However, serial ports are still frequently used in applications demanding simple, low-speed interfaces, such as industrial automation systems, scientific instruments, point of sale systems and some industrial and consumer products.
Server computers may use a serial port as a control console for diagnostics, while networking hardware (such as routers and switches) commonly use serial console ports for configuration, diagnostics, and emergency maintenance access. To interface with these and other devices, USB-to-serial adapters can quickly and easily add a serial port to a modern PC.
Hardware
Modern devices use an integrated circuit called a UART to implement a serial port. This IC converts characters to and from asynchronous serial form, implementing the timing and framing of data specified by the serial protocol in hardware. The IBM PC implements its serial ports, when present, with one or more UARTs.
Very low-cost systems, such as some early home computers, would instead use the CPU to send the data through an output pin, using the bit banging technique. These early home computers often had proprietary serial ports with pinouts and voltage levels incompatible with RS-232.
Before large-scale integration (LSI) made UARTs common, serial ports were commonly used in mainframes and minicomputers, which would have multiple small-scale integrated circuits to implement shift registers, logic gates, counters, and all the other logic needed. As PCs evolved, serial ports were included in the Super I/O chip and then in the chipset.
DTE and DCE The individual signals on a serial port are unidirectional and when connecting two devices, the outputs of one device must be connected to the inputs of the other. Devices are divided into two categories: data terminal equipment (DTE) and data circuit-terminating equipment (DCE). A line that is an output on a DTE device is an input on a DCE device and vice versa, so a DCE device can be connected to a DTE device with a straight-wired cable, in which each pin on one end goes to the same numbered pin on the other end.
Conventionally, computers and terminals are DTE, while peripherals such as modems are DCE. If it is necessary to connect two DTE (or DCE) devices together, a cable with reversed TX and RX lines, known as a cross-over, roll-over or null modem cable must be used.
Gender Generally, serial port connectors are gendered, only allowing connectors to mate with a connector of the opposite gender. With D-subminiature connectors, the male connectors have protruding pins and female connectors have corresponding round sockets. Either type of connector can be mounted on equipment or a panel; or terminate a cable.
Connectors mounted on DTE are likely to be male, and those mounted on DCE are likely to be female (with the cable connectors being the opposite). However, this is far from universal; for instance, most serial printers have a female DB25 connector, but they are DTEs. In this circumstance, the appropriately gendered connectors on the cable or a gender changer can be used to correct the mismatch.
Connectors The only connector specified in the original RS-232 standard was the 25-pin D-subminiature; however, many other connectors have been used to save money or save on physical space, among other reasons. In particular, since many devices do not use all of the 20 signals that are defined by the standard, connectors with fewer pins are often used. While specific examples follow, countless other connectors have been used for RS-232 connections.
The 9-pin DE-9 connector has been used by most IBM-compatible PCs since the Serial/Parallel Adapter option for the PC-AT, where the 9-pin connector allowed a serial and parallel port to fit on the same card. This connector has been standardized for RS-232 as TIA-574.
Some miniaturized electronics, particularly graphing calculators and hand-held amateur and two-way radio equipment, have serial ports using a phone connector, usually the smaller 2.5 or 3.5 mm connectors and the most basic 3-wire interface—transmit, receive and ground.
8P8C connectors are also used in many devices. The EIA/TIA-561 standard defines a pinout using this connector, while the rollover cable (or Yost standard) is commonly used on Unix computers and network devices, such as equipment from Cisco Systems.
Many models of Macintosh favor the related RS-422 standard, mostly using circular mini-DIN connectors. The Macintosh included a standard set of two ports for connection to a printer and a modem, but some PowerBook laptops had only one combined port to save space.
10P10C connectors can be found on some devices.
Another common connector is a pin header common on motherboards and add-in cards which is usually converted via a ribbon cable to the more standard 9-pin DE-9 connector (and frequently mounted on a free slot plate or other part of the housing).
Pinouts
+Pin assignments of common RS-232 signalsSignal Connector pinName V.24 circuit Origin MMJ 8P8C ("RJ45") 10P10C ("RJ50") EIA/TIA-561 Yost (DTE) Yost (DCE) Cyclades Digi (ALTPIN option) National Digi Transmitted Data 103 TxD DTE 2 3 2 6 6 3 3 4 8 4 5 Received Data 104 RxD DCE 3 2 5 5 3 6 6 5 9 7 6 Data Terminal Ready 108/2 DTR DTE 20 4 1 3 7 2 2 8 7 3 9 Data Carrier Detect 109 DCD DCE 8 1 2 2 7 7 1 10 8 10 Data Set Ready 107 DSR DCE 6 6 6 1 8 5 9 2 Ring Indicator 125 RI DCE 22 9 2 10 1 Request To Send 105 (133) RTS DTE 4 7 8 8 1 1 2 4 2 3 Clear To Send 106 CTS DCE 5 8 7 1 8 5 7 3 6 8 Signal Ground 102 G 7 5 3, 4 4 4, 5 4, 5 4 6 6 5 7 Protective Ground 101 PG 1 3 1 4
Hardware abstraction Operating systems usually create symbolic names for the serial ports of a computer, rather than requiring programs to refer to them by hardware address.
Unix-like operating systems usually label the serial port devices . TTY is a common trademark-free abbreviation for teletype, a device commonly attached to early computers' serial ports, and represents a string identifying the specific port; the syntax of that string depends on the operating system and the device.
On Linux, serial ports intended for general communication have names that start with followed by a type prefix consisting of capital letters and ending with a sequence number starting with . For example, 8250/16550 UART serial ports are named (, , ...etc); USB adapters appear as , , or ; other types have yet other prefixes. Some virtual serial ports not intended for general communication have names that intentionally do not match this pattern.
The DOS and Windows environments refer to serial ports as COM ports and are named followed by a sequence number beginning with : , , ..etc.
Common applications This list includes some of the more common devices that are connected to the serial port on a PC. Some of these, such as modems and serial mice, are falling into disuse, while others are readily available. Serial ports are very common on most types of microcontroller, where they can be used to communicate with a PC or other serial devices.
Dial-up modems Configuration and management of networking equipment such as routers, switches, firewalls, load balancers GPS receivers (typically NMEA 0183 at ) Bar code scanners and other point of sale devices LED and LCD text displays Satellite phones, low-speed satellite modems and other satellite-based transceiver devices Flat-panel displays to control screen functions by external computer, other AV components or remotes Test and measuring equipment such as digital multimeters and weighing systems Updating firmware on various consumer devices CNC controllers Uninterruptible power supply management and status reporting Stenography or Stenotype machines Software debuggers that run on a second computer Console or debugger interface to microprocessor development or evaluation boards Industrial field buses Printers Computer terminal, teletype Networking (Macintosh AppleTalk using RS-422 at ) Serial mouse
Since the control signals for a serial port can be driven by any digital signal, some applications used the control lines of a serial port to monitor external devices, without exchanging serial data. A common commercial application of this principle was for some models of uninterruptible power supply which used the control lines to signal loss of power, low battery, and other status information. At least some Morse code training software used a code key connected to the serial port to simulate actual code use; the status bits of the serial port could be sampled very rapidly and at predictable times, making it possible for the software to decipher Morse code.
Serial computer mice and low-power data converters (e.g. RS-232 to 422 converters) may draw their operating power from the received data or control signals.. This mode is also known as "self powered".
Settings + Common serial port speeds Bit rate Time per bit (μs) Windows predefined serial port speed Common applications 75 13333.3 110 9090.9 Bell 101 modem 134.5 7434.9 IBM 2741 terminal 150 6666.6 300 3333.3 Bell 103 modem or V.21 modem 600 1666.7 1,200 833.3 Bell 202, Bell 212A, or V.22 modem 1,800 555.6 2,400 416.7 V.22bis modem 4,800 208.3 V.27ter modem 7,200 138.9 9,600 104.2 V.32 modem 14,400 69.4 V.32bis modem 19,200 52.1 31,250 32 MIDI port 38,400 26.0 56,000 17.9 V.90/V.92 modem 57,600 17.4 V.32bis modem with V.42bis compression 76,800 13.0 115,200 8.68 V.34 modem with V.42bis compression, low cost serial V.90/V.92 modem with V.42bis or V.44 compression 125,000 8.00 ISO 11898-3 CAN bus 128,000 7.81 Basic Rate Interface ISDN terminal adapter 230,400 4.34 LocalTalk, Econet, high end serial V.90/V.92 modem with V.42bis or V.44 compression 250,000 4.0 DMX512, stage lighting and effects network 256,000 3.91
Serial standards provide for many different operating speeds as well as adjustments to the protocol to account for different operating conditions. The most well-known options are speed, number of data bits per character, parity, and number of stop bits per character.
In modern serial ports using a UART integrated circuit, all these settings can be software-controlled. Hardware from the 1980s and earlier may require setting switches or jumpers on a circuit board.
The configuration for serial ports designed to be connected to a PC has become a de facto standard, usually stated as 9600/8-N-1.
Speed Serial ports use two-level (binary) signaling, so the data rate in bits per second is equal to the symbol rate in baud. The total speed includes bits for framing (stop bits, parity, etc.) and so the effective data rate is lower than the bit transmission rate. For example, with 8-N-1 character framing, only 80% of the bits are available for data; for every eight bits of data, two more framing bits are sent.