Chemistry Reference and  Research
           
 
Periodic Table
- standard table
- large table
 
Chemical Elements
- by name
- by symbol
- by atomic number
 
Chemical Properties
 
Chemical Reactions
 
Organic Chemistry
 
Branches of Chemistry
Analytical chemistry
Biochemistry
Computational Chemistry
Electrochemistry
Environmental chemistry
Geochemistry
Inorganic chemistry
Materials science
Medicinal chemistry
Nuclear chemistry
Organic chemistry
Pharmacology
Physical chemistry
Polymer chemistry
Supramolecular Chemistry
Thermochemistry

Serial port

In computing, a serial port is an interface on a computer system with which information is transferred in or out one bit at a time (contrast parallel port). Throughout most of the history of personal computers, this was accomplished using the RS-232 standard over simple cables connecting the computer to a device such as a terminal or modem. Mice, keyboards, and other devices were also often connected this way.

Contents

Hardware

On the IBM PC and compatible computers, the standard serial ports were implemented with a special-purpose hardware chip, called a UART, that converted characters to serial form. Very early personal computers used a variety of UART chips with slightly different programming models. Some machines, particularly low-cost home computers would not use a dedicated chip at all and instead would use the CPU to send the data through an output pin, using the so-called bit-banging technique.

While RS-232 originally specified a 25-pin D-type connector, these were large and awkward, and most of the pins were unused (after all, since data is sent one bit at a time, only one wire is needed for data in each direction plus a few control signals), so it was common to use other connectors for these ports (in particular the DE-9 version used by the original IBM PC-AT).

On many models of Macintosh the related RS-422 standard was popular, and often used German DIN connectors.

In very recent years, more advanced electronics has made possible more reliable and higher-speed serial communications, so RS-232 is being supplanted by newer standards such as USB and Firewire. These make it possible to connect devices that would not have been feasible over slower serial connections, such as storage devices and sound and video devices.

In Linux, the serial port devices are usually called /dev/ttyS* where * is a number starting with 0. In Windows (particularly older versions such as Windows 3.x or Windows 95) serial ports are referred to as COM1, COM2, etc.

Port addresses

Traditionally IBM PC systems have allocated their first four serial ports according to the configuration in the table below. Note that Microsoft design references since 1997 have depreciated use of an RS- 232 serial port and some Windows-compatible personal computers are no longer equipped with these ports as standard.

PORT NAME Interrupt # Starting I/O Ending I/O
COM1 IRQ 4 0x3f8 0x3ff
COM2 IRQ 3 0x2f8 0x2ff
COM3 IRQ 4 0x3e8 0x3ef
COM4 IRQ 3 0x2e8 0x2ef

Settings

There is a multitude of software settings for serial connections. Most common settings are speed, parity, and stop bits.

Speed is bit speed from one device to another in bits per second (bit/s). Common bit rates per second are 300, 1200, 2400, 9600, 19200, etc. Typically both devices must be set to the same speed but some devices (such as modems) may be set to autodetect speed. 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,000 bits per second, though not all bit rates are possible with all serial port clock generators.

Parity is a method of checking the accuracy of transmitted characters. In the context of personal computers, parity is usually not used, but can be odd or even. Parity none is simple, the data is not changed. In even parity the data is arranged so that the total count of 1 bits in each data character is an even number, by setting a parity bit to parity bit (usually the last or most significant bit) to be a 0 or 1 accordingly. In odd parity the number of 1 bits is an odd number. Parity can be used by the receiver to detect transmission errors - 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 insure data validity and request retransmission of data that has been incorrectly received.

Stop bits are sent at the end of every byte transmitted in order to allow the receiving signal hardware to resynchronise. Electronic devices usuallly use one stop bit. Occasionally, and esepecially if electromechanical devices are used such as printers, one-and-one half or two stop bits are required.

There is a D/P/S conventional notation for specifying the software setup of a serial connection. 8/N/1 (very common) specifies 8 data bits, no parity, 1 stop bit. The number of data bits can be 7, 8, or (sometimes) 9. Parity can be none (N), odd (O), or even (E); the parity bit is borrowed from the data bits, so 8/E/1 means that one of the 8 data bits is used as the parity bit.

Other settings define when pins will send handshake signals, or other data integrity checks. Common combinations are RTS/CTS, DTR/DSR, or XON/XOFF (which actually does not use connector pins but rather special characters inserted into the data streams).

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. The use of XON/XOFF is deprecated, and it is preferable to use RTS/CTS flow control instead.

XON/XOFF is an in-band method that works between the endpoints, but both ends must support the protocol, and there is the potential for confusion in starting up. It can be done on a 3 wire interface. RTS/CTS was originally intended to allow the teletype and the modem to coordinate half-duplex links where only one modem could transmit at a time. The terminal would raise Request To Send and wait for the modem to respond with Clear To Send. RTS/CTS is a hardware handshake, but it does have advantages.

See also

01-04-2007 01:16:19
The contents of this article are licensed from Wikipedia.org under the GNU Free Documentation License. How to see transparent copy