Friday, August 23, 2013

Serial port




Serial port (also called communication - COM ports) is a serial communication pyhsical interface through which information transfers in or out one bit at a time (in contrast to a parallel port). In the history of personal computers, data was transferred through serial ports to devices such as modems, terminals and various peripherals. Serial port is considered to be one the most basic external connections to a computer and pretty much all computer OS in use today support serial ports.

The name "serial" is from the fact that a serial port "serializes" data. That means it takes a byte of data and transmits the 8 bits in the byte one at a time. It is 8 times slower than parallel port. Before each byte of data, a serial port sends a start bit, which is a single bit with a value of 0. After each byte of data, it sends a stop bit to signal that the byte is complete. It may also send a parity bit.

Serial ports are bi-directional. Bi-directional coomunication allows both sides of devices to send and receive data.

An important aspect of serial communications is the concept of flow control. This is the ability of one device to tell another device to stop sending data for a while. The commands Request to Send (RTS), Clear To Send (CTS), Data Terminal Ready (DTR) and Data Set Ready (DSR) are used to enable flow control.

Here is an example of flow control:
Let's say you have a modem that communicates at 56 Kbps. But the serial connection between your computer and your modem is 112 Kbps, over twice as fast. As the data transmission keeps going, data transferred to modem will pile up. Even if the modem has a 128K buffer to store data in, it will still quickly run out of buffer space and be unable to function properly with all that data streaming in. With flow control, the modem can stop the flow of data from the computer before it overruns the modem's buffer. The computer is constantly sending a signal on the Request to Send pin, and checking for a signal on the Clear to Send pin. If there is no Clear to Send response, the computer stops sending data, waiting for the Clear to Send before it resumes.

No comments: