Serial Port Article Index for
Serial
Website Links For
Serial
 

Information About

Serial Port




In Computing , a serial port consists of an Interface on a Computer System through which information transfers in or out one Bit at a time (contrast Parallel Port ). Throughout most of the history of Personal Computer s, data transfer using serial ports took place using the RS-232 standard over simple cables connecting the computer to a device such as a Terminal or a Modem . Mice , Keyboard s, and other devices also connected to their hosts in this way.

While such interfaces as Ethernet networks, FireWire , and USB all send data as a serial Stream , the term "serial port" usually identifies hardware intended to interface with a Modem or with a similar communication device.


HARDWARE

Some computers, such as the IBM PC , used an Integrated Circuit called a UART , that converted characters to (and from) Asynchronous Serial form, and automatically looked after the timing and Framing of data. Very low-cost systems, such as some early Home Computer s, would instead use the CPU to send the data through an Output pin, using the so-called Bit-banging technique.

While the version used by the original IBM PC-AT ). Presence of a D-subminiature connector is neither necessary nor sufficient to indicate use of a serial port.

Many models of Macintosh favored the related RS-422 standard, often using
German DIN connectors.

In Recent Years , advanced electronics has made economical higher-speed serial communications possible, so newer serial communication standards such as USB and FireWire have started to supplant RS-232 . These make it possible to connect devices that would not have operated feasibly over slower serial connections, such as storage devices, sound devices, and video devices.

  • where --- represents a number starting with 0. The Microsoft MS-DOS and Windows environments refer to serial ports as COM1, COM2, etc.



SETTINGS

Software can control a multitude of software settings for serial connections, most commonly setting speed, parity, and stop bits. One of the simplifications made in such standards as Ethernet, Fire Wire, and USB involves setting many of these parameters to fixed values so that users can not and need not change the configuration.


Speed

Speed is bit speed from one device to another in Bits Per Second (bit/s). Common bit rates per second for asynchronous start/stop communication are 300, 1200, 2400, 9600, 19200 bit/s, etc. The port speed and device speed must match, though some devices may automatically detect the speed of the serial port. Although the RS 232 standard is formally limited to 20,000 bits per second, serial ports on popular personal computers allow settings up to 115,200 bits per second, but not all bit rates are possible with all serial port clock generators.

The speed includes bits for framing (stop bits, parity, etc.) and the effective data rate is lower than the bit transmission rate. For example for 8-N-1 encoding only 80% of the bits are available for data (for every eight bits of data two more bits are sent).


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 may have been no errors or an even number of errors. A single Parity Bit does not allow implementation of Error Correction on each character, and Communication Protocols working over serial data links have higher-level checksums to ensure data validity and request retransmission of data that has been incorrectly received.

The parity of the serial protocol can besides none, odd and even also be set to space and mark. 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 never used.


Stop bits

Stop bits are sent at the end of every byte transmitted in order to allow the receiving signal hardware to resynchronise. Electronic devices usually use one stop bit. Occasionally, and especially if electromechanical devices are used such as Printer s, 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. The number of data bits can be 7, 8, or (sometimes) 9. Parity is specified as none (N), odd (O), or even (E), with some systems supporting mark (M) or space (S) to denote a constant 1 or 0 bit for parity.

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 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. See the separate article on Transmit Flow Control .

Another method of flow control may use special characters such as XON/XOFF 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.
If the control characters are part of the data stream, they must be sent as part of an Escape Sequence 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.


SEE ALSO


  • RS-232 This page contains more of the technical details including pin assignments.

  • Parallel Port

  • Telegraph describes the history of teleprinters, the devices that the serial port was developed to drive.