PS/2 port
   HOME

TheInfoList



OR:

The PS/2 port is a 6-pin
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. Design Mini-DIN connectors are in diameter and come in seven patterns, wit ...
used for connecting keyboards and
mice A mouse ( : mice) is a small rodent. Characteristically, mice are known to have a pointed snout, small rounded ears, a body-length scaly tail, and a high breeding rate. The best known mouse species is the common house mouse (''Mus musculus'' ...
to a
PC compatible IBM PC compatible computers are similar to the original IBM PC, XT, and AT, all from computer giant IBM, that are able to use the same software and expansion cards. Such computers were referred to as PC clones, IBM clones or IBM PC clones. ...
computer system. Its name comes from the
IBM Personal System/2 The Personal System/2 or PS/2 is IBM's second generation of personal computers. Released in 1987, it officially replaced the IBM PC, XT, AT, and PC Convertible in IBM's lineup. Many of the PS/2's innovations, such as the 16550 UART (serial p ...
series of
personal computer A personal computer (PC) is a multi-purpose microcomputer whose size, capabilities, and price make it feasible for individual use. Personal computers are intended to be operated directly by an end user, rather than by a computer expert or te ...
s, with which it was introduced in 1987. The PS/2 mouse connector generally replaced the older
DE-9 The D-subminiature or D-sub is a common type of electrical connector. They are named for their characteristic D-shaped metal shield. When they were introduced, D-subs were among the smallest connectors used on computer systems. Description, no ...
RS-232 In telecommunications, RS-232 or Recommended Standard 232 is a standard originally introduced in 1960 for serial communication transmission of data. It formally defines signals connecting between a ''DTE'' ('' data terminal equipment'') suc ...
"serial mouse" connector, while the PS/2 keyboard connector replaced the larger 5-pin/180°
DIN connector The DIN connector is an electrical connector that was standardized by the ' (DIN), the German Institute for Standards, in the early 1970s. The male DIN connectors (plugs) feature a 13.2 mm diameter metal shield with a notch that limits the ...
used in the IBM PC/AT design. The PS/2 keyboard port is electrically and logically identical to the IBM AT keyboard port, differing only in the type of electrical connector used. The PS/2 platform introduced a second port with the same design as the keyboard port for use to connect a mouse; thus the PS/2-style keyboard and mouse interfaces are electrically similar and employ the same communication protocol. However, unlike the otherwise similar Apple Desktop Bus connector used by Apple, a given system's keyboard and mouse port may not be interchangeable since the two devices use different sets of commands and the device drivers generally are hard-coded to communicate with each device at the address of the port that is conventionally assigned to that device. (That is, keyboard drivers are written to use the first port, and mouse drivers are written to use the second port.)


Communication protocol

Each port implements a
bidirectional Bidirectional may refer to: * Bidirectional, a roadway that carries traffic moving in opposite directions * Bi-directional vehicle, a tram or train or any other vehicle that can be controlled from either end and can move forward or backward with e ...
synchronous Synchronization is the coordination of events to operate a system in unison. For example, the conductor of an orchestra keeps the orchestra synchronized or ''in time''. Systems that operate with all parts in synchrony are said to be synchronou ...
serial channel. The channel is slightly asymmetrical: it favors transmission from the input device to the computer, which is the majority case. The bidirectional IBM AT and PS/2 keyboard interface is a development of the unidirectional IBM PC keyboard interface, using the same signal lines but adding capability to send data back to the keyboard from the computer; this explains the asymmetry. The interface has two main signal lines, Data and Clock. These are single-ended signals driven by open-collector drivers at each end. Normally, the transmission is from the device to the host. To transmit a byte, the device simply outputs a serial frame of data (including 8 bits of data and a parity bit) on the Data line serially as it toggles the Clock line once for each bit. The host controls the direction of communication using the Clock line; when the host pulls it low, communication from the attached device is inhibited. The host can interrupt the device by pulling Clock low while the device is transmitting; the device can detect this by Clock staying low when the device releases it to go high as the device-generated clock signal toggles. When the host pulls Clock low, the device must immediately stop transmitting and release Clock and Data to both float high. (So far, all of this is the same as the unidirectional communication protocol of the IBM PC keyboard port, though the serial frame formats differ.) The host can use this state of the interface simply to inhibit the device from transmitting when the host is not ready to receive. (For the IBM PC keyboard port, this was the only normal use of signalling from the computer to the keyboard. The keyboard could not be commanded to retransmit a keyboard scan code after it had been sent, since there was no reverse data channel to carry commands to the keyboard, so the only way to avoid losing scan codes when the computer was too busy to receive them was to inhibit the keyboard from sending them until the computer was ready. This mode of operation is still an option on the IBM AT and PS/2 keyboard port.) To send a byte of data back to the device, the host pulls Clock low, waits briefly, pulls Data low and releases the Clock line again. The ''device'' then generates a Clock signal while the host outputs a frame of bits on the Data line, one bit per Clock pulse, similar to what the attached device would do to transmit in the other direction. However, while device-to-host transmission reads bits on falling Clock edges, transmission in the other direction reads bits on rising edges. After the data byte, the host releases the Data line, and the device will pull the Data line low for one clock period to indicate successful reception. A keyboard normally interprets the received byte as a command or a parameter for a preceding command. The device will not attempt to transmit to the host until both Clock and Data have been high for a minimum period of time. Transmission from the device to the host is favored because from the normal idle state, the device does not have to seize the channel before it can transmit—the device just begins transmitting immediately. In contrast, the host must seize the channel by pulling first the Clock line and then the Data line low and waiting for the device to have time to release the channel and prepare to receive; only then can the host begin to transmit data.


Port availability

Older
laptop A laptop, laptop computer, or notebook computer is a small, portable personal computer (PC) with a screen and alphanumeric keyboard. Laptops typically have a clam shell form factor with the screen mounted on the inside of the upper li ...
s and most contemporary motherboards have a single port that supports either a keyboard or a mouse. Sometimes the port also allows one of the devices to be connected to the two normally unused pins in the connector to allow both to be connected at once through a special splitter cable. This configuration is common on IBM/
Lenovo Lenovo Group Limited, often shortened to Lenovo ( , ), is a Chinese multinational technology company specializing in designing, manufacturing, and marketing consumer electronics, personal computers, software, business solutions, and related se ...
Thinkpad notebooks among many others. The PS/2 keyboard interface is electrically the same as the 5-pin DIN connector on earlier
AT keyboard The Model F was a series of computer keyboards produced mainly from 1981–1985 and in reduced volume until 1994 by IBM and later Lexmark. Its mechanical-key design consisted of a buckling spring over a capacitive PCB, similar to the later Mod ...
s, and keyboards designed for one can be connected to the other with a simple wiring adapter. Such wiring adapters and adapter cables were once commonly available for sale. Note that IBM PC and PC XT keyboards use a different unidirectional protocol with the same DIN connector as AT keyboards, so though a PC or XT keyboard can be connected to PS/2 port using a wiring adapter intended for an AT keyboard, the earlier keyboard will not work with the PS/2 port. (At least, it cannot work with normal PS/2 keyboard driver software, including the system BIOS keyboard driver.) In contrast to this, the PS/2 mouse interface is substantially different from
RS-232 In telecommunications, RS-232 or Recommended Standard 232 is a standard originally introduced in 1960 for serial communication transmission of data. It formally defines signals connecting between a ''DTE'' ('' data terminal equipment'') suc ...
(which was generally used for mice on PCs without PS/2 ports), but nonetheless many mice were made that could operate on both with a simple passive wiring adapter, where the mice would detect the presence of the adapter based on its wiring and then switch protocols accordingly. PS/2 mouse and keyboard connectors have also been used in non-IBM PC-compatible computer systems, such as the DEC
AlphaStation AlphaStation is the name given to a series of computer workstations, produced from 1994 onwards by Digital Equipment Corporation, and later by Compaq and HP. As the name suggests, the AlphaStations were based on the DEC Alpha 64-bit micropro ...
line, early IBM
RS/6000 The RISC System/6000 (RS/6000) is a family of Reduced instruction set computer, RISC-based Unix Server (computing), servers, workstations and supercomputers made by IBM in the 1990s. The RS/6000 family replaced the IBM RT PC computer platform in ...
CHRP machines and SGI Indy, Indigo 2, and newer (
Octane Octane is a hydrocarbon and an alkane with the chemical formula , and the condensed structural formula . Octane has many structural isomers that differ by the amount and location of branching in the carbon chain. One of these isomers, 2,2,4-t ...
, etc.) computers. Macintosh clone computers based on the "LPX-40" logic board design featured PS/2 mouse and keyboard ports, including the
Motorola StarMax The Motorola StarMax was a line of licensed Macintosh clones produced by Motorola Information Systems Group in 1996 and 1997. They used versions of Apple's Tanzania motherboard, which was designed to use standard IBM PC compatible components ...
and the Power Computing PowerBase.


Legacy port status and USB

PS/2 is now considered a legacy port, with USB ports now normally preferred for connecting keyboards and mice. This dates back at least as far as the
Intel Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California. It is the world's largest semiconductor chip manufacturer by revenue, and is one of the developers of the x86 ser ...
/
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washi ...
PC 2001 specification of 2000. However, as of 2022, although PS/2 ports are rarely included in off the shelf computer systems, they continue to be included on many computer motherboards and are favored by some users for various reasons including the following: * PS/2 ports may be favored for security reasons in a corporate environment as they allow USB ports to be totally disabled, preventing the connection of any USB removable disks and malicious USB devices. * The PS/2 interface provides no restriction on key rollover, although USB keyboards have no such restriction either, unless operated in BOOT mode, which is the exception. * To free USB ports for other uses like removable USB devices. * Some USB keyboards may not be able to operate the
BIOS In computing, BIOS (, ; Basic Input/Output System, also known as the System BIOS, ROM BIOS, BIOS ROM or PC BIOS) is firmware used to provide runtime services for operating systems and programs and to perform hardware initialization during the b ...
on certain motherboards due to driver issues or lack of support. The PS/2 interface has near-universal compatibility with BIOS.


Latency of mice

USB mice send data more quickly than PS/2 mice because standard USB mice are polled at a default rate of 125 hertz while standard PS/2 mice send interrupts at a default rate of 100 Hz when they have data to send to the computer. However, PS2 mice and keyboards are favored by many gamers because they essentially have zero latency through the port. There is no "polling" needed by the OS. The device notifies the OS when it's time to receive a packet of data from it. Also, USB mice do not cause the USB controller to interrupt the system when they have no status change to report according to the USB HID specification's default profile for mice. Both PS/2 and USB allow the sample rate to be overridden, with PS/2 supporting a sampling rate of up to 200 Hz and USB supporting a polling rate up to 1 kHz as long as the mouse runs at full-speed USB speeds or higher.


USB key rollover limitations

The USB HID keyboard interface requires that it explicitly handle key rollover, with the full HID keyboard class supporting n-key rollover. However, the USB boot keyboard class (designed to allow the BIOS to easily provide a keyboard in the absence of OS USB HID support) only allows 6-key rollover. Some keyboard peripherals support only the latter class, and some OSes may fail to switch to using the full HID keyboard class with a device after boot.


Conversion between PS/2 and USB

Many keyboards and mice were specifically designed to support both the USB and the PS/2 interfaces and protocols, selecting the appropriate connection type at power-on. Such devices are generally equipped with a USB connector and ship with a ''
passive Passive may refer to: * Passive voice, a grammatical voice common in many languages, see also Pseudopassive * Passive language, a language from which an interpreter works * Passivity (behavior), the condition of submitting to the influence of o ...
'' wiring adapter to allow connection to a PS/2 port. Such passive adapters are not standardized and may therefore be specific to the device they came with. Connecting them to a PS/2 port would require a protocol converter, ''actively'' translating between the protocols. Such adapters only support certain classes of USB devices such as keyboards and mice, but are not model- or vendor-specific. Older PS/2-only peripherals can be connected to a USB port via an ''active'' converter, which generally provides a pair of PS/2 ports (which may be designated as one keyboard and one mouse, even though both ports may support both protocols) at the cost of one USB port on the host computer.


Color code

Original PS/2 connectors were black or had the same color as the connecting cable (mainly white). Later the
PC 97 The PC System Design Guide (also known as the PC-97, PC-98, PC-99, or PC 2001 specification) is a series of hardware design requirements and recommendations for IBM PC compatible personal computers, compiled by Microsoft and Intel Corporation durin ...
standard introduced a color code: the keyboard port, and the plugs on compliant keyboards, were purple; mouse ports and plugs were green. (Some vendors initially used a different color code;
Logitech Logitech International S.A. ( ; often shortened to Logi) is a Swiss multinational manufacturer of computer peripherals and software, with headquarters in Lausanne, Switzerland, and Newark, California. The company has offices throughout Europe ...
used the color orange for the keyboard connector for a short period, but soon switched to purple.) Today this code is still used on most PCs. The pinouts of the connectors are the same, but most computers will not recognize devices connected to the wrong port.


Hardware issues


Hotplugging

PS/2 ports are designed to connect the digital I/O lines of the microcontroller in the external device directly to the digital lines of the microcontroller on the motherboard. They are ''not'' designed to be
hot swappable Hot swapping is the replacement or addition of components to a computer system without stopping, shutting down, or rebooting the system; hot plugging describes the addition of components only. Components which have such functionality are said ...
. Hot swapping PS/2 devices usually does not cause damage because more modern microcontrollers tend to have more robust I/O lines built into them which are harder to damage than those of older controllers; however, hot swapping can still potentially cause damage on older machines, or machines with less robust port implementations. If they are hot swapped, the devices must be similar enough that the driver running on the host system recognizes and can be used with the new device. Otherwise, the new device will not function properly. While this is seldom an issue with standard keyboard devices, the host system rarely recognizes the new device attached to the PS/2 mouse port. In practice most keyboards can be hot swapped but this should be avoided.


Durability

PS/2 connectors are not designed to be plugged in and out very often, which can lead to bent or broken pins. Additionally, PS/2 connectors only insert in one direction and must be rotated correctly before attempting connection. (If a user attempts to insert the connector in the wrong orientation and then tries to rotate it to the correct orientation without first pulling it out, then bent pins could result.) Most but not all connectors include an arrow or flat section which is usually aligned to the right or top of the jack before being plugged in. The exact direction may vary on older or non- ATX computers and care should be taken to avoid damaged or bent pins when connecting devices. This issue is slightly alleviated in modern times with the advent of the PS/2-to-USB adapter: users can just leave a PS/2 connector plugged into the PS/2-to-USB adapter at all times and not risk damaging the pins this way. A USB-to-PS/2 adapter does not have this problem.


Fault isolation

In a standard implementation both PS/2 ports are usually controlled by a single microcontroller on the motherboard. This makes design and manufacturing extremely simple and cheap. However, a rare side effect of this design is that a malfunctioning device can cause the controller to become confused, resulting in ''both'' devices acting erratically. (A well designed and programmed controller will not behave in this way.) The resulting problems can be difficult to troubleshoot (e.g., a bad mouse can cause problems that appear to be the fault of the keyboard and vice versa).


See also

* BIOS interrupt call *
DIN connector The DIN connector is an electrical connector that was standardized by the ' (DIN), the German Institute for Standards, in the early 1970s. The male DIN connectors (plugs) feature a 13.2 mm diameter metal shield with a notch that limits the ...
on
IBM PC keyboard The keyboard for IBM PC-compatible computers is standardized. However, during the more than 30 years of PC architecture being frequently updated, many keyboard layout variations have been developed. A well-known class of IBM PC keyboards is the ...
s *
Bus mouse A bus mouse is a variety of PC computer mouse which is attached to the computer using a specialized interface (originally, the Microsoft InPort interface developed for Microsoft's original mouse product). In the late 1980s, mice were not in ...
* Connections on
mice A mouse ( : mice) is a small rodent. Characteristically, mice are known to have a pointed snout, small rounded ears, a body-length scaly tail, and a high breeding rate. The best known mouse species is the common house mouse (''Mus musculus'' ...
* DE-9 connector * USB


References


External links

* * . * . * . {{DEFAULTSORT:PS 2 connector Computer connectors Deutsches Institut für Normung Computer keyboards Pointing devices Computer-related introductions in 1987 Computer hardware standards