Serial port: Difference between revisions
Line 14: | Line 14: | ||
[[[Link title]wikipedia sucks serious a-hole!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!]]''' |
[[[Link title]wikipedia sucks serious a-hole!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!]]''' |
||
==wikipedia sucks== |
|||
==Common applications for serial ports== |
|||
wikipedia sucks serios a- hole!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|||
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]] |
|||
* Dial-up modems |
|||
* Printers |
|||
* [[Computer network|Networking]] (Macintosh [[AppleTalk]] at 230.4kbit/s) |
|||
* Serial Mice |
|||
* GPS receivers (typically [[NMEA 0183]] at 4800bit/s) |
|||
* Older GSM phones |
|||
* [[Satellite phone]]s, low-speed satellite modems and other satellite based transceiver devices |
|||
* [[Microcontroller]], [[EPROM]] and other programmers |
|||
* Bar code scanners and other [[point of sale]] devices |
|||
* LED and LCD text displays |
|||
* Homebrew electronic devices |
|||
* Test and measuring equipment such as digital [[multimeter]]s and weighing systems |
|||
* Updating [[Firmware]] on various consumer devices. |
|||
==Settings== |
==Settings== |
Revision as of 17:32, 12 January 2009
![](http://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Serial_port.jpg/250px-Serial_port.jpg)
![](http://upload.wikimedia.org/wikipedia/commons/thumb/f/f5/MiniDIN-8_Diagram.svg/250px-MiniDIN-8_Diagram.svg.png)
In computing, a serial port is a serial communication physical interface through which information transfers in or out one bit at a time (contrast parallel port). Throughout most of the history of personal computers, data transfer through serial ports connected the computer to devices such as terminals and various peripherals.
While such interfaces as Ethernet, FireWire, and USB all send data as a serial stream, the term "serial port" usually identifies hardware more or less compliant to the RS-232 standard, intended to interface with a modem or with a similar communication device.
For its use to connect peripheral devices the serial port has largely been replaced by USB and IEEE1394. For networking, it has been replaced by Ethernet. For console use with terminals (and then graphics) it was replaced long ago by MDA and then VGA. 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, 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) 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.
Bold text
[[[Link title]wikipedia sucks serious a-hole!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!]]
wikipedia sucks
wikipedia sucks serios a- hole!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Settings
Many settings are required for serial connections used for asynchronous start-stop 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 bauds. These rates are based on multiples of the rates for electromechanical teleprinters. 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 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), 6 (rarely used), 7 (for true ASCII), 8 (for any kind of data, as this matches the size of a byte), 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 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). 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 does not allow implementation of error correction on each character, and communication protocols 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 teleprinters 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 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 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 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 cards, 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, 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 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
![](http://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Wikibooks-logo-en-noslogan.svg/40px-Wikibooks-logo-en-noslogan.svg.png)
- RS-232 This page describes the details of the standard including pin assignments.
- Teleprinter describes the history of the devices that the serial port was developed to drive.
- rfcomm