HOME

TheInfoList



OR:

In
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, e ...
, a serial port is a serial communication
interface Interface or interfacing may refer to: Academic journals * ''Interface'' (journal), by the Electrochemical Society * '' Interface, Journal of Applied Linguistics'', now merged with ''ITL International Journal of Applied Linguistics'' * '' Int ...
through which information transfers in or out sequentially one
bit The bit is the most basic unit of information in computing and digital communications. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represente ...
at a time. This is in contrast to a parallel port, which communicates multiple bits simultaneously in
parallel Parallel is a geometric term of location which may refer to: Computing * Parallel algorithm * Parallel computing * Parallel metaheuristic * Parallel (software), a UNIX utility for running programs in parallel * Parallel Sysplex, a cluster of ...
. Throughout most of the history of
personal computer A personal computer (PC) is a multi-purpose microcomputer whose size, capabilities, and price make it feasible for individual use. Personal computers are intended to be operated directly by an end user, rather than by a computer expert or tec ...
s, data has been transferred through serial ports to devices such as
modem A modulator-demodulator or modem is a computer hardware device that converts data from a digital format into a format suitable for an analog transmission medium such as telephone or radio. A modem transmits data by Modulation#Digital modulati ...
s,
terminal Terminal may refer to: Computing Hardware * Terminal (electronics), a device for joining electrical circuits together * Terminal (telecommunication), a device communicating over a line * Computer terminal, a set of primary input and output dev ...
s, various peripherals, and directly between computers. While interfaces such as
Ethernet Ethernet () is a family of wired computer networking technologies commonly used in local area networks (LAN), metropolitan area networks (MAN) and wide area networks (WAN). It was commercially introduced in 1980 and first standardized in 198 ...
, FireWire, and
USB Universal Serial Bus (USB) is an industry standard that establishes specifications for cables, connectors and protocols for connection, communication and power supply (interfacing) between computers, peripherals and other computers. A broad ...
also send data as a serial
stream A stream is a continuous body of water, body of surface water Current (stream), flowing within the stream bed, bed and bank (geography), banks of a channel (geography), channel. Depending on its location or certain characteristics, a stream ...
, the term ''serial port'' usually denotes hardware compliant with
RS-232 In telecommunications, RS-232 or Recommended Standard 232 is a standard originally introduced in 1960 for serial communication transmission of data. It formally defines signals connecting between a ''DTE'' (''data terminal equipment'') such ...
or a related standard, such as
RS-485 RS-485, also known as TIA-485(-A) or EIA-485, is a standard defining the electrical characteristics of drivers and receivers for use in serial communications systems. Electrical signaling is balanced, and multipoint systems are supported. The s ...
or
RS-422 RS-422, also known as TIA/EIA-422, is a technical standard originated by the Electronic Industries Alliance that specifies electrical characteristics of a digital signaling circuit. It was meant to be the foundation of a suite of standards that ...
. Modern consumer
personal computer A personal computer (PC) is a multi-purpose microcomputer whose size, capabilities, and price make it feasible for individual use. Personal computers are intended to be operated directly by an end user, rather than by a computer expert or tec ...
s (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 Server may refer to: Computing *Server (computing), a computer program or a device that provides functionality for other programs or devices, called clients Role * Waiting staff, those who work at a restaurant or a bar attending customers and su ...
computers may use a serial port as a control console for diagnostics, while
networking hardware Networking hardware, also known as network equipment or computer networking devices, are electronic devices which are required for communication and interaction between devices on a computer network. Specifically, they mediate data transmission in ...
(such as routers and
switch In electrical engineering, a switch is an electrical component that can disconnect or connect the conducting path in an electrical circuit, interrupting the electric current or diverting it from one conductor to another. The most common type of ...
es) commonly use serial console ports for configuration, diagnostics, and emergency maintenance access. To interface with these and other devices,
USB-to-serial converter A USB-to-serial adapter or simply USB adapter is a type of protocol converter that is used for converting USB data signals to and from serial communications standards (serial ports). Most commonly the USB data signals are converted to either ...
s can quickly and easily add a serial port to a modern PC.


Hardware

Modern devices use an
integrated circuit An integrated circuit or monolithic integrated circuit (also referred to as an IC, a chip, or a microchip) is a set of electronic circuits on one small flat piece (or "chip") of semiconductor material, usually silicon. Large numbers of tiny ...
called a
UART A universal asynchronous receiver-transmitter (UART ) is a computer hardware device for asynchronous serial communication in which the data format and transmission speeds are configurable. It sends data bits one by one, from the least signific ...
to implement a serial port. This IC converts characters to and from
asynchronous serial Asynchrony is the state of not being in synchronization. Asynchrony or asynchronous may refer to: Electronics and computing * Asynchrony (computer programming), the occurrence of events independent of the main program flow, and ways to deal wit ...
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 Output may refer to: * The information produced by a computer, see Input/output * An output state of a system, see state (computer science) * Output (economics), the amount of goods and services produced ** Gross output in economics, the value o ...
pin, using the
bit banging In computer engineering and electrical engineering, bit banging is a "term of art" for any method of data transmission that employs software as a substitute for dedicated hardware to generate transmitted signals or process received signals. Soft ...
technique. These early home computers often had proprietary serial ports with pinouts and voltage levels incompatible with RS-232. Before
large-scale integration An integrated circuit or monolithic integrated circuit (also referred to as an IC, a chip, or a microchip) is a set of electronic circuits on one small flat piece (or "chip") of semiconductor material, usually silicon. Large numbers of tiny ...
(LSI) made UARTs common, serial ports were commonly used in
mainframes A mainframe computer, informally called a mainframe or big iron, is a computer used primarily by large organizations for critical applications like bulk data processing for tasks such as censuses, industry and consumer statistics, enterprise ...
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 Super I/O is a class of I/O controller integrated circuits that began to be used on personal computer motherboards in the late 1980s, originally as add-in cards, later embedded on the motherboards. A super I/O chip combines interfaces for a vari ...
chip and then in the
chipset In a computer system, a chipset is a set of electronic components in one or more integrated circuits known as a "Data Flow Management System" that manages the data flow between the processor, memory and peripherals. It is usually found on the mo ...
.


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 Data terminal equipment (DTE) is an end instrument that converts user information into signals or reconverts received signals. These can also be called tail circuits. A DTE device communicates with the data circuit-terminating equipment (DCE) ...
'' (DTE) and ''
data circuit-terminating equipment A data circuit-terminating equipment (DCE) is a device that sits between the data terminal equipment (DTE) and a data transmission circuit. It is also called data communication(s) equipment and data carrier equipment. Usually, the DTE device i ...
'' (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
modem A modulator-demodulator or modem is a computer hardware device that converts data from a digital format into a format suitable for an analog transmission medium such as telephone or radio. A modem transmits data by Modulation#Digital modulati ...
s 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 Crossover may refer to: Entertainment Albums and songs * ''Cross Over'' (Dan Peek album) * ''Crossover'' (Dirty Rotten Imbeciles album), 1987 * ''Crossover'' (Intrigue album) * ''Crossover'' (Hitomi Shimatani album) * ''Crossover'' (Yoshino ...
, roll-over or
null modem Null modem is a communication method to directly connect two DTEs (computer, terminal, printer, etc.) using an RS-232 serial cable. The name stems from the historical use of RS-232 cables to connect two teleprinter devices or two modems in orde ...
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 The D-subminiature or D-sub is a common type of electrical connector. They are named for their characteristic D-shaped metal shield. When they were introduced, D-subs were among the smallest connectors used on computer systems. Description, no ...
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 The D-subminiature or D-sub is a common type of electrical connector. They are named for their characteristic D-shaped metal shield. When they were introduced, D-subs were among the smallest connectors used on computer systems. Description, n ...
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 In telecommunications, RS-232 or Recommended Standard 232 is a standard originally introduced in 1960 for serial communication transmission of data. It formally defines signals connecting between a ''DTE'' (''data terminal equipment'') such ...
. Some miniaturized electronics, particularly
graphing calculator A graphing calculator (also graphics calculator or graphic display calculator) is a handheld computer that is capable of plotting graphs, solving simultaneous equations, and performing other tasks with variables. Most popular graphing calcu ...
s and hand-held
amateur An amateur () is generally considered a person who pursues an avocation independent from their source of income. Amateurs and their pursuits are also described as popular, informal, autodidacticism, self-taught, user-generated, do it yourself, DI ...
and
two-way radio A two-way radio is a radio that can both transmit and receive radio waves (a transceiver), unlike a broadcast receiver which only receives content. It is an audio (sound) transceiver, a transmitter and receiver in one unit, used for bidirecti ...
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 Rollover cable (also known as a Yost cable, Cisco cable, or a Console cable) is a type of null-modem cable that is used to connect a computer terminal to a router's console port. This cable is typically flat (and has a light blue color) to help ...
(or Yost standard) is commonly used on
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
computers and network devices, such as equipment from
Cisco Systems Cisco Systems, Inc., commonly known as Cisco, is an American-based multinational corporation, multinational digital communications technology conglomerate (company), conglomerate corporation headquartered in San Jose, California. Cisco develo ...
. Many models of
Macintosh The Mac (known as Macintosh until 1999) is a family of personal computers designed and marketed by Apple Inc. Macs are known for their ease of use and minimalist designs, and are popular among students, creative professionals, and software en ...
favor the related RS-422 standard, mostly using circular
mini-DIN connector The mini-DIN connectors are a family of multi-pin electrical connectors used in a variety of applications. Mini-DIN is similar to the larger, older DIN connector. Design Mini-DIN connectors are in diameter and come in seven patterns, wi ...
s. 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 A pin header (or simply header) is a form of electrical connector. A male pin header consists of one or more rows of metal pins molded into a plastic base, often apart, though available in many spacings. Male pin headers are cost-effective du ...
common on motherboards and add-in cards which is usually converted via a
ribbon cable A ribbon cable (also known as multi-wire planar cable) is a cable with many conducting wires running parallel to each other on the same flat plane. As a result, the cable is wide and flat. Its name comes from its resemblance to a piece of ribb ...
to the more standard 9-pin DE-9 connector (and frequently mounted on a free slot plate or other part of the housing).


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 A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
operating systems usually label the serial port devices . ''TTY'' is a common trademark-free abbreviation for ''
teletype A teleprinter (teletypewriter, teletype or TTY) is an electromechanical device that can be used to send and receive typed messages through various communications channels, in both point-to-point and point-to-multipoint configurations. Init ...
'', 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 Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
, 8250/ 16550 UART hardware serial ports are named , USB adapters appear as and various types of virtual serial ports do not necessarily have names starting with . The
DOS DOS is shorthand for the MS-DOS and IBM PC DOS family of operating systems. DOS may also refer to: Computing * Data over signalling (DoS), multiplexing data onto a signalling channel * Denial-of-service attack (DoS), an attack on a communicat ...
and
Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
environments refer to serial ports as COM ports: COM1, COM2,..etc.


Common applications for serial ports

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
modem A modulator-demodulator or modem is a computer hardware device that converts data from a digital format into a format suitable for an analog transmission medium such as telephone or radio. A modem transmits data by Modulation#Digital modulati ...
s * Configuration and management of networking equipment such as routers,
switches In electrical engineering, a switch is an electrical component that can disconnect or connect the conducting path in an electrical circuit, interrupting the electric current or diverting it from one conductor to another. The most common type of ...
, firewalls,
load balancer In computing, load balancing is the process of distributing a set of tasks over a set of resources (computing units), with the aim of making their overall processing more efficient. Load balancing can optimize the response time and avoid unevenl ...
s *
GPS The Global Positioning System (GPS), originally Navstar GPS, is a satellite-based radionavigation system owned by the United States government and operated by the United States Space Force. It is one of the global navigation satellite sy ...
receivers (typically
NMEA 0183 NMEA 0183 is a combined electrical and data specification for communication between marine electronics such as echo sounder, sonars, anemometer, gyrocompass, autopilot, GPS receivers and many other types of instruments. It has been defined and is c ...
at ) *
Bar code scanner A barcode reader is an optical scanner that can read printed barcodes, decode the data contained in the barcode to a computer. Like a flatbed scanner, it consists of a light source, a lens and a light sensor for translating optical impulses into ...
s and other point of sale devices *
LED A light-emitting diode (LED) is a semiconductor Electronics, device that Light#Light sources, emits light when Electric current, current flows through it. Electrons in the semiconductor recombine with electron holes, releasing energy i ...
and LCD text displays * Satellite phones, low-speed satellite modems and other satellite based transceiver devices *
Flat-panel display A flat-panel display (FPD) is an electronic display used to display visual content such as text or images. It is present in consumer, medical, transportation, and industrial equipment. Flat-panel displays are thin, lightweight, provide better l ...
s to control screen functions by external computer, other AV components or remotes * Test and measuring equipment such as digital
multimeter A multimeter is a measuring instrument that can measure multiple electrical properties. A typical multimeter can measure voltage, resistance, and current, in which case it is also known as a volt-ohm-milliammeter (VOM), as the unit is equipped w ...
s and weighing systems * Updating
firmware In computing, firmware is a specific class of computer software that provides the low-level control for a device's specific hardware. Firmware, such as the BIOS of a personal computer, may contain basic functions of a device, and may provide h ...
on various consumer devices * CNC controllers *
Uninterruptible power supply An uninterruptible power supply or uninterruptible power source (UPS) is an electrical apparatus that provides emergency power to a load when the input power source or mains power fails. A UPS differs from an auxiliary or emergency power syste ...
management and status reporting * Stenography or Stenotype machines * Software debuggers that run on a second computer * Industrial field buses *
Printer Printer may refer to: Technology * Printer (publishing), a person or a company * Printer (computing), a hardware device * Optical printer for motion picture films People * Nariman Printer (fl. c. 1940), Indian journalist and activist * James ...
s *
Computer terminal A computer terminal is an electronic or electromechanical hardware device that can be used for entering data into, and transcribing data from, a computer or a computing system. The teletype was an example of an early-day hard-copy terminal and ...
,
teletype A teleprinter (teletypewriter, teletype or TTY) is an electromechanical device that can be used to send and receive typed messages through various communications channels, in both point-to-point and point-to-multipoint configurations. Init ...
* 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 An uninterruptible power supply or uninterruptible power source (UPS) is an electrical apparatus that provides emergency power to a load when the input power source or mains power fails. A UPS differs from an auxiliary or emergency power syste ...
which used the control lines to signal loss of power, low battery, and other status information. At least some
Morse code Morse code is a method used in telecommunication to encode text characters as standardized sequences of two different signal durations, called ''dots'' and ''dashes'', or ''dits'' and ''dahs''. Morse code is named after Samuel Morse, one of ...
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.


Settings

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 8-N-1 is a common shorthand notation for a serial port parameter setting or configuration in asynchronous mode, in which there is one start bit, eight (8) data bits, no (N) parity bit, and one (1) stop bit. As such, 8-N-1 is the most common co ...
character framing, only 80% of the bits are available for data; for every eight bits of data, two more framing bits are sent. A standard series of rates is based on multiples of the rates for electromechanical
teleprinter A teleprinter (teletypewriter, teletype or TTY) is an electromechanical device that can be used to send and receive typed messages through various communications channels, in both point-to-point and point-to-multipoint configurations. Init ...
s; some serial ports allow many arbitrary rates to be selected, but the speeds on both sides of the connection must match for data to be received correctly. Bit rates commonly supported include 75, 110, 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600 and 115200 bit/s. Many of these standard modem baud rates are multiples of either 0.9 kbps (e.g., 19200, 38400, 76800) or 1.2 kbps (e.g., 57600, 115200).
Crystal oscillator A crystal oscillator is an electronic oscillator circuit that uses a piezoelectric crystal as a frequency-selective element. The oscillator frequency is often used to keep track of time, as in quartz wristwatches, to provide a stable cloc ...
s with a frequency of 1.843200 MHz are sold specifically for this purpose. This is 16 times the fastest bit rate, and the serial port circuit can easily divide this down to lower frequencies as required. The capability to set a bit rate does not imply that a working connection will result. Not all bit rates are possible with all serial ports. Some special-purpose protocols such as
MIDI MIDI (; Musical Instrument Digital Interface) is a technical standard that describes a communications protocol, digital interface, and electrical connectors that connect a wide variety of electronic musical instruments, computers, and ...
for musical instrument control, use serial data rates other than the teleprinter standards. Some serial port implementations can automatically choose a bit rate by observing what a connected device is sending and synchronizing to it.


Data bits

The number of data bits in each character can be 5 (for
Baudot code The Baudot code is an early character encoding for telegraphy invented by Émile Baudot in the 1870s. It was the predecessor to the International Telegraph Alphabet No. 2 (ITA2), the most common teleprinter code in use until the advent of ASCII ...
), 6 (rarely used), 7 (for true
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because of ...
), 8 (for most kinds of data, as this size matches the size of a
byte The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable unit ...
), or 9 (rarely used). 8 data bits are almost universally used in newer applications. 5 or 7 bits generally only make sense with older equipment such as teleprinters. Most serial communications designs send the data bits within each byte least significant bit first. Also possible, but rarely used, is
most significant bit In computing, bit numbering is the convention used to identify the bit positions in a binary number. Bit significance and indexing In computing, the least significant bit (LSB) is the bit position in a binary integer representing the binar ...
first; this was used, for example, by the
IBM 2741 The IBM 2741 is a printing computer terminal that was introduced in 1965. Compared to the teletypewriter machines that were commonly used as printing terminals at the time, the 2741 offers 50% higher speed, much higher quality printing, quieter op ...
printing terminal. The order of bits is not usually configurable within the serial port interface but is defined by the host system. To communicate with systems that require a different bit ordering than the local default, local software can re-order the bits within each byte just before sending and just after receiving.


Parity

''Parity'' is a method of detecting errors in transmission. When parity is used with a serial port, an extra data bit is sent with each data character, arranged so that the number of 1 bits in each character, including the parity bit, is always odd or always even. If a byte is received with the wrong number of 1s, then it must have been corrupted. Correct parity does not necessarily indicate absence of corruption as a corrupted transmission with an even number of errors will pass the parity check. A single parity bit does not allow implementation of error correction on each character, and
communication protocol A communication protocol is a system of rules that allows two or more entities of a communications system to transmit information via any kind of variation of a physical quantity. The protocol defines the rules, syntax, semantics and synchroniza ...
s working over serial data links will typically have higher-level mechanisms to ensure data validity and request retransmission of data that has been incorrectly received. The parity bit in each character can be set to one of the following: * None (N) means that no parity bit is sent and the transmission is shortened. * Odd (O) means that the parity bit is set so that the number of 1 bits is odd. * Even (E) means that the parity bit is set so that the number of 1 bits is even. * Mark (M) parity means that the parity bit is always set to the mark signal condition (1 bit value). * Space (S) parity always sends the parity bit in the space signal condition (0 bit value). Aside from uncommon applications that use the last bit (usually the 9th) for some form of addressing or special signaling, mark or space parity is uncommon, as it adds no error detection information. Odd parity is more useful than even parity since it ensures that at least one state transition occurs in each character, which makes it more reliable at detecting errors like those that could be caused by serial port speed mismatches. The most common parity setting, however, is ''none'', with error detection handled by a communication protocol. To allow detection of messages damaged by
line noise In electronics, noise is an unwanted disturbance in an electrical signal. Noise generated by electronic devices varies greatly as it is produced by several different effects. In particular, noise is inherent in physics, and central to the ...
, electromechanical teleprinters were arranged to print a special character when received data contained a parity error.


Stop bits

Stop bits sent at the end of every character allow the receiving signal hardware to detect the end of a character and to resynchronize with the character stream. Electronic devices usually use one stop bit. If slow electromechanical
teleprinter A teleprinter (teletypewriter, teletype or TTY) is an electromechanical device that can be used to send and receive typed messages through various communications channels, in both point-to-point and point-to-multipoint configurations. Init ...
s are used, one-and-one half or two stop bits may be required.


Conventional notation

The data/parity/stop (D/P/S) conventional notation specifies the framing of a serial connection. The most common usage on microcomputers is 8/N/1 (8N1). This specifies 8 data bits, no parity, 1 stop bit. In this notation, the parity bit is not included in the data bits. 7/E/1 (7E1) means that an even parity bit is added to the 7 data bits for a total of 8 bits between the start and stop bits.


Flow control

Flow control is used in circumstances where a transmitter might be able to send data faster than the receiver is able to process it. To cope with this, serial lines often incorporate a
handshaking A handshake is a globally widespread, brief greeting or parting tradition in which two people grasp one of each other's like hands, in most cases accompanied by a brief up-and-down movement of the grasped hands. Customs surrounding handshakes a ...
method. There are ''hardware'' and ''software'' handshaking methods. Hardware handshaking is done with extra signals, often the RS-232 RTS/CTS or DTR/DSR signal circuits. RTS and CTS are used to control data flow, signaling, for instance, when a buffer is almost full. Per the RS-232 standard and its successors, DTR and DSR are used to signal that equipment is present and powered up so are usually asserted at all times. However, non-standard implementations exist, for example, printers that use DTR as flow control. Software handshaking is done for example with
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because of ...
control characters XON/XOFF to control the flow of data. The XON and XOFF characters are sent by the receiver to the sender to control when the sender will send data, that is, these characters go in the opposite direction to the data being sent. The system starts in the ''sending allowed'' state. When the receiver's buffers approach capacity, the receiver sends the XOFF character to tell the sender to stop sending data. Later, after the receiver has emptied its buffers, it sends an XON character to tell the sender to resume transmission. It is an example of
in-band signaling In telecommunications, in-band signaling is the sending of control information within the same band or channel used for data such as voice or video. This is in contrast to out-of-band signaling which is sent over a different channel, or even o ...
, where control information is sent over the same channel as its data. The advantage of hardware handshaking is that it can be extremely fast, it works independently of imposed meaning such as ASCII on the transferred data and it is stateless. Its disadvantage is that it requires more hardware and cabling, and both ends of the connection must support the hardware handshaking protocol used. The advantage of software handshaking is that it can be done with absent or incompatible hardware handshaking circuits and cabling. The disadvantage, common to all in-band control signaling, is that it introduces complexities in ensuring that control messages get through even when data messages are blocked, and data can never be mistaken for control signals. The former is normally dealt with by the operating system or device driver; the latter normally by ensuring that control codes are escaped (such as in the Kermit protocol) or omitted by design (such as in ANSI terminal control). If no handshaking is employed, an overrun receiver might simply fail to receive data from the transmitter. Approaches for preventing this include reducing the speed of the connection so that the receiver can always keep up, increasing the size of buffers so it can keep up averaged over a longer time, using delays after time-consuming operations (e.g. in
termcap Termcap (''terminal capability'') is a software library and database used on Unix-like computers. It enables programs to use display computer terminals in a device-independent manner, which greatly simplifies the process of writing portable text ...
) or employing a mechanism to resend data which has not been received correctly (e.g. TCP).


See also

* * *
Teleprinter A teleprinter (teletypewriter, teletype or TTY) is an electromechanical device that can be used to send and receive typed messages through various communications channels, in both point-to-point and point-to-multipoint configurations. Init ...
Device that motivated serial port development *


References


Further reading

* ''Serial Port Complete: COM Ports, USB Virtual COM Ports, and Ports for Embedded Systems''; 2nd Edition; Jan Axelson; Lakeview Research; 380 pages; 2007; .


External links

*
RS-232 and other serial port pinouts list
{{Basic computer components Computer connectors Legacy hardware Out-of-band management Serial buses