All Topics  
Serial port

 
Serial Port

   Email Print
   Bookmark   Link






 

Serial port



 
 
In computing
Computing

Computing is usually defined as the activity of using and developing computer technology, computer hardware and computer software. It is the computer-specific part of information technology....
, a serial port is a serial communication physical interface through which information transfers in or out one bit
Bit

A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory....
 at a time (contrast parallel port
Parallel port

A parallel port is a type of interface found on computers for connecting various peripherals. It is also known as a printer port or Centronics#The interface....
).






Discussion
Ask a question about 'Serial port'
Start a new discussion about 'Serial port'
Answer questions from other users
Full Discussion Forum



Recent Posts









Encyclopedia


Serial Port
Minidin 8 Diagram
In computing
Computing

Computing is usually defined as the activity of using and developing computer technology, computer hardware and computer software. It is the computer-specific part of information technology....
, a serial port is a serial communication physical interface through which information transfers in or out one bit
Bit

A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory....
 at a time (contrast parallel port
Parallel port

A parallel port is a type of interface found on computers for connecting various peripherals. It is also known as a printer port or Centronics#The interface....
). Throughout most of the history of personal computer
Personal computer

A personal computer is any general-purpose computer whose original sales price, size, and capabilities make it useful for individuals, and which is intended to be operated directly by an end user, with no intervening computer operator....
s, data transfer through serial ports connected the computer to devices such as terminal
Computer terminal

A computer terminal is an electronic or electromechanical computer hardware device that is used for entering data into, and displaying data from, a computer or a computing system....
s and various peripherals.

While such interfaces as Ethernet
Ethernet

Ethernet is a family of Data frame-based computer networking technologies for local area networks . The name comes from the physical concept of the Luminiferous aether....
, FireWire
FireWire

The IEEE 1394 interface is a serial communications interface standard for high-speed communications and isochronous real-time data transfer, frequently used by personal computers, as well as in digital audio, digital video, automotive, and aeronautics applications....
, and USB all send data as a serial stream, the term "serial port" usually identifies hardware more or less compliant to the RS-232
RS-232

In telecommunications, RS-232 is a standard for serial communications binary data signals connecting between a DTE and a DCE . It is commonly used in computer serial ports....
 standard, intended to interface with a modem
Modem

Modem is a peripheral device that modulation an analog carrier wave Signal to encode digital information, and also demodulation such a carrier signal to decode the transmitted information....
 or with a similar communication device.

For its use to connect peripheral devices the serial port has largely been replaced by USB
Universal Serial Bus

In information technology, Universal Serial Bus is a Serial communications computer bus standard to electrical connector devices to a host computer....
 and Firewire
FireWire

The IEEE 1394 interface is a serial communications interface standard for high-speed communications and isochronous real-time data transfer, frequently used by personal computers, as well as in digital audio, digital video, automotive, and aeronautics applications....
. For networking, it has been replaced by Ethernet
Ethernet

Ethernet is a family of Data frame-based computer networking technologies for local area networks . The name comes from the physical concept of the Luminiferous aether....
. For console use with terminals (and then graphics) it was replaced long ago by MDA and then VGA
Video Graphics Array

The term Video Graphics Array refers specifically to the display hardware first introduced with the IBM Personal System/2 line of computers in 1987, but through its widespread adoption has also come to mean either an analogue electronics computer display standard, the 15-pin D-subminiature VGA connector or the 640×480 resolution its...
. While nearly every server has a serial port connector, most non-poweruser workstations and laptops do not have a outwardly wired one as it is a legacy port
Legacy port

A legacy port is a port or connector on a IBM PC clone that is considered fully or partially obsolete. Some manufacturers, particularly in laptops, remove the legacy ports, making way for modern ports such as Universal Serial Bus....
, and superseded for most uses. Serial ports are commonly still used in legacy applications such as industrial automation systems, scientific analysis, shop till systems and some industrial and consumer products. Network equipment (such as routers and switches) often use serial console for configuration. Serial ports are still used in these areas as they are simple, cheap and their console functions (RS-232
RS-232

In telecommunications, RS-232 is a standard for serial communications binary data signals connecting between a DTE and a DCE . It is commonly used in computer serial ports....
) are highly standardized and widespread.

The vast majority of computer systems have a serial port, however it must usually be wired manually and sometimes there are no pins in the manufactured version.

Hardware

Some computers, such as the IBM PC
IBM PC

The IBM Personal Computer, commonly known as the IBM PC, is the original version and progenitor of the IBM PC compatible hardware platform ....
, used an integrated circuit
Integrated circuit

In electronics, an integrated circuit is a miniaturized electronic circuit that has been manufactured in the surface of a thin Wafer of semiconductor material....
  called a UART, that converted characters to (and from) asynchronous serial form, and automatically looked after the timing and framing
Asynchronous start-stop

Asynchronous serial communication describes an asynchronous communication, Serial communication in which a start signal is sent prior to each byte, character or code word and a stop signal is sent after each code word....
 of data. Very low-cost systems, such as some early home computer
Home computer

A home computer was a class of personal computer entering the market in 1977 and becoming common during the 1980s. They were marketed to consumers as accessible personal computers, more capable than video game consoles....
s, would instead use the CPU
Central processing unit

A central processing unit is an electronic circuit that can execute computer programs. This broad definition can easily be applied to many early computers that existed long before the term "CPU" ever came into widespread usage....
 to send the data through an output
Input/output

In computing, input/output, or I/O, refers to the communication between an information processing system , and the outside world ? possibly a human, or another information processing system....
 pin, using the so-called bit-banging
Bit-banging

Bit-banging is a technique for serial communications to use software instead of dedicated hardware such as a UART or shift register. A software routine handles the UART transmit function by alternating a pin on the microcontroller by given time intervals....
 technique.

Many personal computer motherboards still have at least one serial port. Small-form-factor systems and laptops may omit RS-232 connector ports to conserve space, but the electronics are still there. RS-232 has been standard for so long that the circuits needed to control a serial port became very cheap and often exist on a single chip, sometimes also with circuitry for a parallel port.

Early home computer
Home computer

A home computer was a class of personal computer entering the market in 1977 and becoming common during the 1980s. They were marketed to consumers as accessible personal computers, more capable than video game consoles....
s often had proprietary serial ports with pinouts and voltage levels incompatible with RS-232. Inter-operation with RS-232 devices may be impossible as the serial port cannot withstand the voltage levels produced and may have other differences that "lock in
Vendor lock-in

In economics, vendor lock-in, also known as proprietary lock-in, or customer lock-in, makes a customer dependent on a vendor for Product s and Service , unable to use another vendor without substantial switching barriers....
" the user to products of a particular manufacturer.

Low-cost processors now allow higher-speed, but more complex, serial communication standards such as USB
Universal Serial Bus

In information technology, Universal Serial Bus is a Serial communications computer bus standard to electrical connector devices to a host computer....
 and FireWire
FireWire

The IEEE 1394 interface is a serial communications interface standard for high-speed communications and isochronous real-time data transfer, frequently used by personal computers, as well as in digital audio, digital video, automotive, and aeronautics applications....
 to replace RS-232. These make it possible to connect devices that would not have operated feasibly over slower serial connections, such as mass storage, sound, and video devices.

Connectors

While the RS-232 standard originally specified a 25-pin D-type
D-subminiature

The D-subminiature or D-sub is a common type of electrical connector used particularly in computers. Calling them "subminiature" was appropriate when they were first introduced, but today they are among the largest common connectors used in computers....
 connector, many designers of personal computers chose to implement only a subset of the full standard: they traded off compatibility with the standard against the use of less costly and more compact connectors (in particular the DE-9 version used by the original IBM PC-AT). Starting around the time of the introduction of the IBM PC-AT, serial ports were commonly built with a 9-pin connector to save cost and space. However, presence of a nine pin D-subminiature connector is neither necessary nor sufficient to indicate use of a serial port, since this connector was also used for video, joysticks, and other purposes.

Some miniaturized electronics, particularly graphing calculator
Graphing calculator

A graphing calculator typically refers to a class of handheld calculators that are capable of plotting graph of a function, solving simultaneous equations, and performing numerous other tasks with variables....
s and to a lesser extent hand-held amateur
Amateur radio

Amateur radio, often called Etymology of ham radio, is both a hobby and a service in which participants, called "hams," use various types of radio communications equipment to communicate with other radio amateurs for Public services, recreation and self-training....
 and two-way radio
Two-way radio

A two-way radio is a radio that can both transmit and receive , unlike a broadcasting receiver which only receives content.Two-way radios are available in mobile radio, stationary base station and hand-held portable configurations....
 equipment, have serial ports using a jack plug connector, usually the smaller 2.5 or 3.5 mm connectors and use the most basic 3-wire interface.

Many models of Macintosh favored the related (but faster) RS-422 standard, mostly using German
Germany

Germany , officially the Federal Republic of Germany , is a country in Central Europe. It is bordered to the north by the North Sea, Denmark, and the Baltic Sea; to the east by Poland and the Czech Republic; to the south by Austria and Switzerland; and to the west by France, Luxembourg, Belgium, and the Netherlands....
 Mini-DIN connector
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....
s, except in the earliest models. The Macintosh included a standard set of two ports for connection to a printer and a modem, but some PowerBook
PowerBook

The PowerBook is a line of Macintosh laptop computers that was designed, manufactured and sold by Apple Inc. from 1991 to 2006. During its lifetime, the PowerBook went through several major revisions and redesigns, often being the first to incorporate features that would later become standard in competing laptops....
 laptops had only one combined port to save space.

Hardware abstraction

Operating systems usually use a symbolic name to refer to the serial ports of a computer. Unix-like
Unix

Unix is a computer operating system originally developed in 1969 by a group of American Telephone & Telegraph employees at Bell Labs, including Ken Thompson , Dennis Ritchie, Douglas McIlroy, and Joe Ossanna....
 operating systems usually label the serial port devices /dev/tty* (tty an abbreviation for teletype) where * represents a string identifying the terminal device; the syntax of that string depends on the operating system and the device. The Microsoft MS-DOS
MS-DOS

MS-DOS is an operating system commercialized by Microsoft. It was the most commonly used member of the DOS family of operating systems and was the main operating system for personal computers during the 1980s....
 and Windows
Microsoft Windows

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
 environments refer to serial ports as COM ports: COM1, COM2, etc. On Linux
Linux

Linux is a generic term referring to Unix-like computer operating systems based on the Linux kernel. Their development is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed by anyone under the terms of the GNU GPL license...
, 8250/16550
16550 UART

The 16550 UART is an integrated circuit designed for implementing the interface for serial communications. It is frequently used to implement the serial port for IBM PC compatible personal computers, where it is often connected to an RS-232 interface for modems, serial Computer mouse, printers, and similar peripherals....
 UART hardware serial ports are named /dev/ttyS*, USB adapters appear as /dev/ttyUSB* and various types of virtual serial ports do not necessarily have names starting with tty.

Common applications for serial ports

The RS-232 standard is used by many specialized and custom-built devices. 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.

  • Computer terminal
    Computer terminal

    A computer terminal is an electronic or electromechanical computer hardware device that is used for entering data into, and displaying data from, a computer or a computing system....
  • Dial-up modems
  • Printers
  • Networking
    Computer network

    A computer network is a group of interconnected computers. Networks may be classified according to a wide variety of characteristics. This article provides a general overview of some types and categories and also presents the basic components of a network....
     (Macintosh AppleTalk
    AppleTalk

    AppleTalk is a proprietary protocol protocol stack developed by Apple Inc for networking computers. It was included in the original Macintosh and is now deprecated by Apple in favor of TCP/IP networking....
     at 230.4kbit/s)
  • Serial Mice
  • GPS receivers (typically NMEA 0183 at 4800bit/s)
  • Older GSM phones
  • Satellite phone
    Satellite phone

    A satellite telephone, satellite phone, or satphone is a type of mobile phone that connects to orbiting satellites instead of terrestrial cell sites....
    s, low-speed satellite modems and other satellite based transceiver devices
  • Microcontroller
    Microcontroller

    A microcontroller is a small computer on a single integrated circuit consisting of a relatively simple CPU combined with support functions such as a crystal oscillator, timers, watchdog, serial and analog I/O etc....
    , EPROM
    EPROM

    An EPROM, or Erasable Programmable Read Only Memory, is a type of memory integrated circuit that retains its data when its power supply is switched off....
     and other programmers
  • Bar code scanners and other point of sale
    Point of sale

    Point of sale or point of service can mean a retailing, a checkout counter in a shop, or the location where a financial transaction occurs....
     devices
  • LED and LCD text displays
  • Homemade electronic devices
  • Test and measuring equipment such as digital multimeter
    Multimeter

    A multimeter or a multitester, also known as a volt/ohm meter or VOM, is an Electronics measuring instrument that combines several functions in one unit....
    s and weighing systems
  • Updating Firmware
    Firmware

    Firmware is a term sometimes used to denote the fixed, usually rather small, programs that internally control various electronic devices. Typical examples range from end user products such as remote controls or calculators, via computer parts and devices like harddisks, keyboard s, TFT screens or memory cards, all the way to scientific instr...
     on various consumer devices.


Settings

Many settings are required for serial connections used for asynchronous start-stop
Asynchronous start-stop

Asynchronous serial communication describes an asynchronous communication, Serial communication in which a start signal is sent prior to each byte, character or code word and a stop signal is sent after each code word....
 communication, to select 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 settings are usually software-controlled; hardware from the 1980s and earlier may require setting switches or jumpers on a circuit board. One of the simplifications made in such serial bus standards as Ethernet, FireWire, and USB is that many of those parameters have fixed values so that users can not and need not change the configuration; the speed is either fixed or automatically negotiated. Often if the settings are entered incorrectly the connection will not be dropped; however, any data sent will be received on the other end as nonsense.

Speed

Serial ports use two-level (binary) signaling, so the data rate in bits per second is equal to the symbol rate in baud
Baud

In telecommunications and electronics, baud is synonymous to symbols/s or pulses/s. It is the unit of symbol rate, also known as baud rate or modulation rate; the number of distinct symbol changes made to the transmission medium per second in a digitally modulation signal or a line code....
s. These rates are based on multiples of the rates for electromechanical teleprinter
Teleprinter

A teleprinter is a now largely obsolete electro-mechanical typewriter which can be used to communicate typed messages from Point-to-point and Point-to-multipoint communication over a variety of communications channels that range from a simple electrical connection, such as a pair of wires, to the use of radio and microwave as the transmi...
s. The port speed and device speed must match. Although some devices may automatically detect popular personal computers, allowing for much higher baud rates, 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 for musical instrument control, use serial data rates other than the above series.

The 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

8-N-1 is a common shorthand notation for a serial port parameter setting or computer configuration in Asynchronous start-stop mode, in which there are eight Bits, no parity bit, and one stop bit....
 character framing only 80% of the bits are available for data (for every eight bits of data, two more framing bits are sent).

Data Bits

The number of data bits in each character can be 5 (for Baudot code
Baudot code

The Baudot code, invented by ?mile Baudot, is a character encoding predating EBCDIC and ASCII, and the root predecessor to International Telegraph Alphabet No 2 , the teleprinter code in use until the advent of ASCII....
), 6 (rarely used), 7 (for true ASCII
ASCII

American Standard Code for Information Interchange , is a coding standard that can be used for interchanging information, if the information is expressed mainly by the written form of English words....
), 8 (for any kind of data, as this matches the size of a byte
Byte

A byte is a basic unit of measurement of Computer storage in computer science. In many computer architectures it is a Byte addressing memory address space....
), 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 teleprinter
Teleprinter

A teleprinter is a now largely obsolete electro-mechanical typewriter which can be used to communicate typed messages from Point-to-point and Point-to-multipoint communication over a variety of communications channels that range from a simple electrical connection, such as a pair of wires, to the use of radio and microwave as the transmi...
s.

Most serial communications designs send the data bits within each byte LSB (Least Significant Bit) first. This standard is also referred to as "little endian". Also possible, but rarely used, is "big endian" or MSB (Most Significant Bit) first serial communications (see Endianness
Endianness

In computing, endianness is the byte ordering used to represent some kind of data. Typical cases are the order in which integer values are stored as bytes in computer memory and the transmission order over a network or other medium....
). The order of bits is not usually configurable, but data can be byte-swapped only before sending.

Parity

Parity is a method of detecting some errors in transmission. Where 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 1 bits, then it must have been corrupted. If parity is correct there has been an even number of errors. Electromechanical teleprinters were arranged to print a special character when received data contained a parity error, to allow detection of messages damaged by line noise. A single parity bit
Parity bit

A parity bit is a bit that is added to ensure that the number of bits with value of 1 in a given set of bits is always even number or odd number....
 does not allow implementation of error correction on each character, and communication protocols
Communications protocol

In the field of telecommunications, a communications protocol is the set of standard rules for data representation, Signalling , authentication and Error detection and correction required to send information over a communications channel....
 working over serial data links will 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 none (N), odd (O), even (E), mark (M), or space (S). None means that no parity bit is sent at all. Mark parity means that the parity bit is always set to the mark signal condition (logical 1) and likewise space parity always sends the parity bit in the space signal condition. Aside from uncommon applications that use the 9th (parity) bit for some form of addressing or special signalling, mark or space parity is uncommon, as it adds no error detection information. Odd parity is more common than even, since it ensures that at least one state transition occurs in each character, which makes it more reliable. The most common parity setting, however, is "none", with error detection handled by a communication protocol.

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 resynchronise with the character stream. Electronic devices usually use one stop bit. If slow electromechanical teleprinter
Teleprinter

A teleprinter is a now largely obsolete electro-mechanical typewriter which can be used to communicate typed messages from Point-to-point and Point-to-multipoint communication over a variety of communications channels that range from a simple electrical connection, such as a pair of wires, to the use of radio and microwave as the transmi...
s are used, one-and-one half or two stop bits are required.

Conventional notation

The 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 seven data bits for a total of eight bits between the start and stop bits. If a receiver of a 7/E/1 stream is expecting an 8/N/1 stream, half the possible bytes will be interpreted as having the high bit set.

Flow control

A serial port may use signals in the interface to pause and resume the transmission of data. For example, a slow printer might need to handshake
Handshaking

In information technology, telecommunications, and related fields, handshaking is an automated process of negotiation that dynamically sets parameters of a communications channel established between two entities before normal communication over the channel begins....
 with the serial port to indicate that data should be paused while the mechanism advances a line. Common hardware handshake signals use the RS-232 RTS/CTS, DTR/DSR signal circuits. Generally, the RTS and CTS are turned off and on from alternate ends to control data flow, for instance when a buffer is almost full. DTR and DSR are usually on all the time and are used to signal from each end that the other equipment is actually present and powered-up.

Another method of flow control may use special characters such as XON/XOFF
Xon/Xoff

Software flow control is a method of flow control used in computer data links, especially RS-232. It uses special codes, transmitted in-band signaling, over the primary communications channel....
 to control the flow of data. The XON/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 XON character tells the sender that the receiver is ready for more data. The XOFF character tells the sender to stop sending characters until the receiver is ready again. These are non-printing characters and are interpreted as handshake signals by printers and terminals.

If all possible values of a character must be sent as user data, XON/XOFF handshaking presents difficulties since these codes may appear in user data. Control characters sent as part of the data stream, must be sent as part of an escape sequence
Escape sequence

An escape sequence is a series of character used to change the state of computers and their attached peripheral devices. These are also known as control sequences, reflecting their use in device control....
 to prevent data from being interpreted as flow control. Since no extra signal circuits are required, XON/XOFF flow control can be done on a 3 wire interface.

"Virtual" serial ports

A virtual serial port is an emulation of the standard serial port. This port is created by software which enable extra serial ports in an operating system without additional hardware installation (such as expansion card
Expansion card

An expansion card in computing is a printed circuit board that can be inserted into an expansion slot of a computer motherboard to add additional functionality to a computer system....
s, etc.). Unlike a physical serial port the virtual one can be assigned any name (COM255, VSP33, etc.). It is possible to create unlimited number of virtual serial ports in your PC. The only limitation is the computer performance, as it may require a substantial amount of resources to emulate large numbers of serial ports.

Virtual serial ports emulate all hardware serial port functionality, including Baud rate
Baud

In telecommunications and electronics, baud is synonymous to symbols/s or pulses/s. It is the unit of symbol rate, also known as baud rate or modulation rate; the number of distinct symbol changes made to the transmission medium per second in a digitally modulation signal or a line code....
, Data bits, Parity bits, Stop bits, etc. Additionally they allow controlling the data flow, emulating all signal lines (DTR/DSR/CTS/RTS/DCD/RI) and customizing pinout. Virtual serial ports are common with Bluetooth
Bluetooth

Bluetooth is a wireless protocol for exchanging data over short distances from fixed and mobile devices, creating personal area networks . It was originally conceived as a wireless alternative to RS232 data cables....
 and are the standard way of receiving data from Bluetooth-equipped GPS modules.

Virtual serial port emulation can be useful in case there is a lack of available physical serial ports or they do not meet the current requirements. For instance, virtual serial ports can share data between several applications from one GPS device connected to a serial port. Another option is to communicate with any other serial devices via internet or LAN as if they are locally connected to computer (Serial-over-Ethernet technology). Two computers or applications can communicate through an emulated serial port link. Virtual serial port emulators are available for Microsoft Windows and some of them run under Windows CE, Windows Mobile and Pocket PC.

See also

  • RS-232
    RS-232

    In telecommunications, RS-232 is a standard for serial communications binary data signals connecting between a DTE and a DCE . It is commonly used in computer serial ports....
     This page describes the details of the standard including pin assignments.
  • Teleprinter
    Teleprinter

    A teleprinter is a now largely obsolete electro-mechanical typewriter which can be used to communicate typed messages from Point-to-point and Point-to-multipoint communication over a variety of communications channels that range from a simple electrical connection, such as a pair of wires, to the use of radio and microwave as the transmi...
     describes the history of the devices that the serial port was developed to drive.
  • rfcomm redirects to the article on Bluetooth
    Bluetooth

    Bluetooth is a wireless protocol for exchanging data over short distances from fixed and mobile devices, creating personal area networks . It was originally conceived as a wireless alternative to RS232 data cables....


External links