<s>
The	O
PS/2	B-Protocol
port	I-Protocol
is	O
a	O
6-pin	O
mini-DIN	B-Protocol
connector	I-Protocol
used	O
for	O
connecting	O
keyboards	B-Device
and	O
mice	B-Device
to	O
a	O
PC	O
compatible	O
computer	O
system	O
.	O
</s>
<s>
Its	O
name	O
comes	O
from	O
the	O
IBM	B-Device
Personal	I-Device
System/2	I-Device
series	O
of	O
personal	B-Device
computers	I-Device
,	O
with	O
which	O
it	O
was	O
introduced	O
in	O
1987	O
.	O
</s>
<s>
The	O
PS/2	B-Protocol
mouse	I-Protocol
connector	O
generally	O
replaced	O
the	O
older	O
DE-9	B-Protocol
RS-232	O
"	O
serial	B-Device
mouse	I-Device
"	O
connector	O
,	O
while	O
the	O
PS/2	B-Protocol
keyboard	I-Protocol
connector	O
replaced	O
the	O
larger	O
5-pin/180	O
°	O
DIN	B-Architecture
connector	I-Architecture
used	O
in	O
the	O
IBM	B-Operating_System
PC/AT	I-Operating_System
design	O
.	O
</s>
<s>
The	O
PS/2	B-Protocol
keyboard	I-Protocol
port	O
is	O
electrically	O
and	O
logically	O
identical	O
to	O
the	O
IBM	B-Operating_System
AT	I-Operating_System
keyboard	B-Device
port	O
,	O
differing	O
only	O
in	O
the	O
type	O
of	O
electrical	O
connector	O
used	O
.	O
</s>
<s>
The	O
PS/2	B-Device
platform	O
introduced	O
a	O
second	O
port	O
with	O
the	O
same	O
design	O
as	O
the	O
keyboard	B-Device
port	O
for	O
use	O
to	O
connect	O
a	O
mouse	O
;	O
thus	O
the	O
PS/2	B-Device
-style	O
keyboard	B-Device
and	O
mouse	O
interfaces	O
are	O
electrically	O
similar	O
and	O
employ	O
the	O
same	O
communication	O
protocol	O
.	O
</s>
<s>
However	O
,	O
unlike	O
the	O
otherwise	O
similar	O
Apple	B-Device
Desktop	I-Device
Bus	I-Device
connector	O
used	O
by	O
Apple	O
,	O
a	O
given	O
system	O
's	O
keyboard	B-Device
and	O
mouse	O
port	O
may	O
not	O
be	O
interchangeable	O
since	O
the	O
two	O
devices	O
use	O
different	O
sets	O
of	O
commands	O
and	O
the	O
device	O
drivers	O
generally	O
are	O
hard-coded	O
to	O
communicate	O
with	O
each	O
device	O
at	O
the	O
address	O
of	O
the	O
port	O
that	O
is	O
conventionally	O
assigned	O
to	O
that	O
device	O
.	O
</s>
<s>
(	O
That	O
is	O
,	O
keyboard	B-Device
drivers	O
are	O
written	O
to	O
use	O
the	O
first	O
port	O
,	O
and	O
mouse	O
drivers	O
are	O
written	O
to	O
use	O
the	O
second	O
port	O
.	O
)	O
</s>
<s>
Each	O
port	O
implements	O
a	O
bidirectional	O
synchronous	O
serial	B-Protocol
channel	O
.	O
</s>
<s>
The	O
bidirectional	O
IBM	B-Operating_System
AT	I-Operating_System
and	O
PS/2	B-Protocol
keyboard	I-Protocol
interface	O
is	O
a	O
development	O
of	O
the	O
unidirectional	O
IBM	B-Device
PC	I-Device
keyboard	I-Device
interface	O
,	O
using	O
the	O
same	O
signal	O
lines	O
but	O
adding	O
capability	O
to	O
send	O
data	O
back	O
to	O
the	O
keyboard	B-Device
from	O
the	O
computer	O
;	O
this	O
explains	O
the	O
asymmetry	O
.	O
</s>
<s>
To	O
transmit	O
a	O
byte	O
,	O
the	O
device	O
simply	O
outputs	O
a	O
serial	B-Protocol
frame	O
of	O
data	O
(	O
including	O
8	O
bits	O
of	O
data	O
and	O
a	O
parity	O
bit	O
)	O
on	O
the	O
Data	O
line	O
serially	O
as	O
it	O
toggles	O
the	O
Clock	O
line	O
once	O
for	O
each	O
bit	O
.	O
</s>
<s>
(	O
So	O
far	O
,	O
all	O
of	O
this	O
is	O
the	O
same	O
as	O
the	O
unidirectional	O
communication	O
protocol	O
of	O
the	O
IBM	B-Device
PC	I-Device
keyboard	I-Device
port	O
,	O
though	O
the	O
serial	B-Protocol
frame	O
formats	O
differ	O
.	O
)	O
</s>
<s>
(	O
For	O
the	O
IBM	B-Device
PC	I-Device
keyboard	I-Device
port	O
,	O
this	O
was	O
the	O
only	O
normal	O
use	O
of	O
signalling	O
from	O
the	O
computer	O
to	O
the	O
keyboard	B-Device
.	O
</s>
<s>
The	O
keyboard	B-Device
could	O
not	O
be	O
commanded	O
to	O
retransmit	O
a	O
keyboard	B-Device
scan	O
code	O
after	O
it	O
had	O
been	O
sent	O
,	O
since	O
there	O
was	O
no	O
reverse	O
data	O
channel	O
to	O
carry	O
commands	O
to	O
the	O
keyboard	B-Device
,	O
so	O
the	O
only	O
way	O
to	O
avoid	O
losing	O
scan	O
codes	O
when	O
the	O
computer	O
was	O
too	O
busy	O
to	O
receive	O
them	O
was	O
to	O
inhibit	O
the	O
keyboard	B-Device
from	O
sending	O
them	O
until	O
the	O
computer	O
was	O
ready	O
.	O
</s>
<s>
This	O
mode	O
of	O
operation	O
is	O
still	O
an	O
option	O
on	O
the	O
IBM	B-Operating_System
AT	I-Operating_System
and	O
PS/2	B-Protocol
keyboard	I-Protocol
port	O
.	O
)	O
</s>
<s>
A	O
keyboard	B-Device
normally	O
interprets	O
the	O
received	O
byte	O
as	O
a	O
command	O
or	O
a	O
parameter	O
for	O
a	O
preceding	O
command	O
.	O
</s>
<s>
Older	O
laptops	B-Device
and	O
most	O
contemporary	O
motherboards	O
have	O
a	O
single	O
port	O
that	O
supports	O
either	O
a	O
keyboard	B-Device
or	O
a	O
mouse	O
.	O
</s>
<s>
This	O
configuration	O
is	O
common	O
on	O
IBM/Lenovo	O
Thinkpad	O
notebooks	B-Device
among	O
many	O
others	O
.	O
</s>
<s>
The	O
PS/2	B-Protocol
keyboard	I-Protocol
interface	O
is	O
electrically	O
the	O
same	O
as	O
the	O
5-pin	O
DIN	B-Architecture
connector	I-Architecture
on	O
earlier	O
AT	O
keyboards	B-Device
,	O
and	O
keyboards	B-Device
designed	O
for	O
one	O
can	O
be	O
connected	O
to	O
the	O
other	O
with	O
a	O
simple	O
wiring	O
adapter	O
.	O
</s>
<s>
Note	O
that	O
IBM	O
PC	O
and	O
PC	O
XT	O
keyboards	B-Device
use	O
a	O
different	O
unidirectional	O
protocol	O
with	O
the	O
same	O
DIN	B-Architecture
connector	I-Architecture
as	O
AT	O
keyboards	B-Device
,	O
so	O
though	O
a	O
PC	O
or	O
XT	O
keyboard	B-Device
can	O
be	O
connected	O
to	O
PS/2	B-Protocol
port	I-Protocol
using	O
a	O
wiring	O
adapter	O
intended	O
for	O
an	O
AT	O
keyboard	B-Device
,	O
the	O
earlier	O
keyboard	B-Device
will	O
not	O
work	O
with	O
the	O
PS/2	B-Protocol
port	I-Protocol
.	O
</s>
<s>
(	O
At	O
least	O
,	O
it	O
cannot	O
work	O
with	O
normal	O
PS/2	B-Protocol
keyboard	I-Protocol
driver	O
software	O
,	O
including	O
the	O
system	B-Operating_System
BIOS	I-Operating_System
keyboard	B-Device
driver	O
.	O
)	O
</s>
<s>
In	O
contrast	O
to	O
this	O
,	O
the	O
PS/2	B-Protocol
mouse	I-Protocol
interface	O
is	O
substantially	O
different	O
from	O
RS-232	O
(	O
which	O
was	O
generally	O
used	O
for	O
mice	B-Device
on	O
PCs	B-Device
without	O
PS/2	B-Protocol
ports	I-Protocol
)	O
,	O
but	O
nonetheless	O
many	O
mice	B-Device
were	O
made	O
that	O
could	O
operate	O
on	O
both	O
with	O
a	O
simple	O
passive	O
wiring	O
adapter	O
,	O
where	O
the	O
mice	B-Device
would	O
detect	O
the	O
presence	O
of	O
the	O
adapter	O
based	O
on	O
its	O
wiring	O
and	O
then	O
switch	O
protocols	O
accordingly	O
.	O
</s>
<s>
PS/2	B-Protocol
mouse	I-Protocol
and	O
keyboard	B-Device
connectors	O
have	O
also	O
been	O
used	O
in	O
non-IBM	O
PC-compatible	O
computer	O
systems	O
,	O
such	O
as	O
the	O
DEC	B-Device
AlphaStation	I-Device
line	O
,	O
early	O
IBM	B-Device
RS/6000	I-Device
CHRP	B-Device
machines	O
and	O
SGI	B-Operating_System
Indy	I-Operating_System
,	O
Indigo	B-Application
2	I-Application
,	O
and	O
newer	O
(	O
Octane	B-Device
,	O
etc	O
.	O
)	O
</s>
<s>
Macintosh	O
clone	O
computers	O
based	O
on	O
the	O
"	O
LPX-40	O
"	O
logic	O
board	O
design	O
featured	O
PS/2	B-Protocol
mouse	I-Protocol
and	O
keyboard	B-Device
ports	O
,	O
including	O
the	O
Motorola	B-Device
StarMax	I-Device
and	O
the	O
Power	O
Computing	O
PowerBase	O
.	O
</s>
<s>
PS/2	B-Device
is	O
now	O
considered	O
a	O
legacy	B-Device
port	I-Device
,	O
with	O
USB	B-Protocol
ports	O
now	O
normally	O
preferred	O
for	O
connecting	O
keyboards	B-Device
and	O
mice	B-Device
.	O
</s>
<s>
However	O
,	O
as	O
of	O
2022	O
,	O
although	O
PS/2	B-Protocol
ports	I-Protocol
are	O
rarely	O
included	O
in	O
off	O
the	O
shelf	O
computer	O
systems	O
,	O
they	O
continue	O
to	O
be	O
included	O
on	O
many	O
computer	O
motherboards	O
and	O
are	O
favored	O
by	O
some	O
users	O
for	O
various	O
reasons	O
including	O
the	O
following	O
:	O
</s>
<s>
PS/2	B-Protocol
ports	I-Protocol
may	O
be	O
favored	O
for	O
security	O
reasons	O
in	O
a	O
corporate	O
environment	O
as	O
they	O
allow	O
USB	B-Protocol
ports	O
to	O
be	O
totally	O
disabled	O
,	O
preventing	O
the	O
connection	O
of	O
any	O
USB	B-Protocol
removable	O
disks	O
and	O
malicious	O
USB	B-Protocol
devices	O
.	O
</s>
<s>
The	O
PS/2	B-Protocol
interface	I-Protocol
provides	O
no	O
restriction	O
on	O
key	B-Device
rollover	I-Device
,	O
although	O
USB	B-Protocol
keyboards	B-Device
have	O
no	O
such	O
restriction	O
either	O
,	O
unless	O
operated	O
in	O
BOOT	O
mode	O
,	O
which	O
is	O
the	O
exception	O
.	O
</s>
<s>
To	O
free	O
USB	B-Protocol
ports	O
for	O
other	O
uses	O
like	O
removable	O
USB	B-Protocol
devices	O
.	O
</s>
<s>
Some	O
USB	B-Protocol
keyboards	B-Device
may	O
not	O
be	O
able	O
to	O
operate	O
the	O
BIOS	B-Operating_System
on	O
certain	O
motherboards	O
due	O
to	O
driver	O
issues	O
or	O
lack	O
of	O
support	O
.	O
</s>
<s>
The	O
PS/2	B-Protocol
interface	I-Protocol
has	O
near-universal	O
compatibility	O
with	O
BIOS	B-Operating_System
.	O
</s>
<s>
USB	B-Protocol
mice	B-Device
send	O
data	O
more	O
quickly	O
than	O
PS/2	B-Protocol
mice	I-Protocol
because	O
standard	O
USB	B-Protocol
mice	B-Device
are	O
polled	O
at	O
a	O
default	O
rate	O
of	O
125	O
hertz	O
while	O
standard	O
PS/2	B-Protocol
mice	I-Protocol
send	O
interrupts	O
at	O
a	O
default	O
rate	O
of	O
100Hz	O
when	O
they	O
have	O
data	O
to	O
send	O
to	O
the	O
computer	O
.	O
</s>
<s>
However	O
,	O
PS2	O
mice	B-Device
and	O
keyboards	B-Device
are	O
favored	O
by	O
many	O
gamers	O
because	O
they	O
essentially	O
have	O
zero	O
latency	O
through	O
the	O
port	O
.	O
</s>
<s>
Also	O
,	O
USB	B-Protocol
mice	B-Device
do	O
not	O
cause	O
the	O
USB	B-Protocol
controller	O
to	O
interrupt	O
the	O
system	O
when	O
they	O
have	O
no	O
status	O
change	O
to	O
report	O
according	O
to	O
the	O
USB	B-Protocol
HID	O
specification	O
's	O
default	O
profile	O
for	O
mice	B-Device
.	O
</s>
<s>
Both	O
PS/2	B-Device
and	O
USB	B-Protocol
allow	O
the	O
sample	O
rate	O
to	O
be	O
overridden	O
,	O
with	O
PS/2	B-Device
supporting	O
a	O
sampling	O
rate	O
of	O
up	O
to	O
200Hz	O
and	O
USB	B-Protocol
supporting	O
a	O
polling	O
rate	O
up	O
to	O
1kHz	O
as	O
long	O
as	O
the	O
mouse	O
runs	O
at	O
full-speed	O
USB	B-Protocol
speeds	O
or	O
higher	O
.	O
</s>
<s>
The	O
USB	B-Protocol
HID	O
keyboard	B-Device
interface	O
requires	O
that	O
it	O
explicitly	O
handle	O
key	B-Device
rollover	I-Device
,	O
with	O
the	O
full	O
HID	O
keyboard	B-Device
class	O
supporting	O
n-key	O
rollover	O
.	O
</s>
<s>
However	O
,	O
the	O
USB	B-Protocol
boot	O
keyboard	B-Device
class	O
(	O
designed	O
to	O
allow	O
the	O
BIOS	B-Operating_System
to	O
easily	O
provide	O
a	O
keyboard	B-Device
in	O
the	O
absence	O
of	O
OS	O
USB	B-Protocol
HID	O
support	O
)	O
only	O
allows	O
6-key	O
rollover	O
.	O
</s>
<s>
Some	O
keyboard	B-Device
peripherals	O
support	O
only	O
the	O
latter	O
class	O
,	O
and	O
some	O
OSes	O
may	O
fail	O
to	O
switch	O
to	O
using	O
the	O
full	O
HID	O
keyboard	B-Device
class	O
with	O
a	O
device	O
after	O
boot	O
.	O
</s>
<s>
Many	O
keyboards	B-Device
and	O
mice	B-Device
were	O
specifically	O
designed	O
to	O
support	O
both	O
the	O
USB	B-Protocol
and	O
the	O
PS/2	B-Protocol
interfaces	I-Protocol
and	O
protocols	O
,	O
selecting	O
the	O
appropriate	O
connection	O
type	O
at	O
power-on	O
.	O
</s>
<s>
Such	O
devices	O
are	O
generally	O
equipped	O
with	O
a	O
USB	B-Protocol
connector	O
and	O
ship	O
with	O
a	O
passive	O
wiring	O
adapter	O
to	O
allow	O
connection	O
to	O
a	O
PS/2	B-Protocol
port	I-Protocol
.	O
</s>
<s>
Connecting	O
them	O
to	O
a	O
PS/2	B-Protocol
port	I-Protocol
would	O
require	O
a	O
protocol	O
converter	O
,	O
actively	O
translating	O
between	O
the	O
protocols	O
.	O
</s>
<s>
Such	O
adapters	O
only	O
support	O
certain	O
classes	O
of	O
USB	B-Protocol
devices	O
such	O
as	O
keyboards	B-Device
and	O
mice	B-Device
,	O
but	O
are	O
not	O
model	O
-	O
or	O
vendor-specific	O
.	O
</s>
<s>
Older	O
PS/2	B-Device
-only	O
peripherals	O
can	O
be	O
connected	O
to	O
a	O
USB	B-Protocol
port	O
via	O
an	O
active	O
converter	O
,	O
which	O
generally	O
provides	O
a	O
pair	O
of	O
PS/2	B-Protocol
ports	I-Protocol
(	O
which	O
may	O
be	O
designated	O
as	O
one	O
keyboard	B-Device
and	O
one	O
mouse	O
,	O
even	O
though	O
both	O
ports	O
may	O
support	O
both	O
protocols	O
)	O
at	O
the	O
cost	O
of	O
one	O
USB	B-Protocol
port	O
on	O
the	O
host	O
computer	O
.	O
</s>
<s>
Original	O
PS/2	B-Protocol
connectors	I-Protocol
were	O
black	O
or	O
had	O
the	O
same	O
color	O
as	O
the	O
connecting	O
cable	O
(	O
mainly	O
white	O
)	O
.	O
</s>
<s>
Later	O
the	O
PC	O
97	O
standard	O
introduced	O
a	O
color	O
code	O
:	O
the	O
keyboard	B-Device
port	O
,	O
and	O
the	O
plugs	O
on	O
compliant	O
keyboards	B-Device
,	O
were	O
purple	O
;	O
mouse	O
ports	O
and	O
plugs	O
were	O
green	O
.	O
</s>
<s>
(	O
Some	O
vendors	O
initially	O
used	O
a	O
different	O
color	O
code	O
;	O
Logitech	O
used	O
the	O
color	O
orange	O
for	O
the	O
keyboard	B-Device
connector	O
for	O
a	O
short	O
period	O
,	O
but	O
soon	O
switched	O
to	O
purple	O
.	O
)	O
</s>
<s>
Today	O
this	O
code	O
is	O
still	O
used	O
on	O
most	O
PCs	B-Device
.	O
</s>
<s>
PS/2	B-Protocol
ports	I-Protocol
are	O
designed	O
to	O
connect	O
the	O
digital	O
I/O	O
lines	O
of	O
the	O
microcontroller	O
in	O
the	O
external	O
device	O
directly	O
to	O
the	O
digital	O
lines	O
of	O
the	O
microcontroller	O
on	O
the	O
motherboard	O
.	O
</s>
<s>
They	O
are	O
not	O
designed	O
to	O
be	O
hot	B-Device
swappable	I-Device
.	O
</s>
<s>
Hot	B-Device
swapping	I-Device
PS/2	B-Device
devices	O
usually	O
does	O
not	O
cause	O
damage	O
because	O
more	O
modern	O
microcontrollers	O
tend	O
to	O
have	O
more	O
robust	O
I/O	O
lines	O
built	O
into	O
them	O
which	O
are	O
harder	O
to	O
damage	O
than	O
those	O
of	O
older	O
controllers	O
;	O
however	O
,	O
hot	B-Device
swapping	I-Device
can	O
still	O
potentially	O
cause	O
damage	O
on	O
older	O
machines	O
,	O
or	O
machines	O
with	O
less	O
robust	O
port	O
implementations	O
.	O
</s>
<s>
While	O
this	O
is	O
seldom	O
an	O
issue	O
with	O
standard	O
keyboard	B-Device
devices	O
,	O
the	O
host	O
system	O
rarely	O
recognizes	O
the	O
new	O
device	O
attached	O
to	O
the	O
PS/2	B-Protocol
mouse	I-Protocol
port	O
.	O
</s>
<s>
In	O
practice	O
most	O
keyboards	B-Device
can	O
be	O
hot	O
swapped	O
but	O
this	O
should	O
be	O
avoided	O
.	O
</s>
<s>
PS/2	B-Protocol
connectors	I-Protocol
are	O
not	O
designed	O
to	O
be	O
plugged	O
in	O
and	O
out	O
very	O
often	O
,	O
which	O
can	O
lead	O
to	O
bent	O
or	O
broken	O
pins	O
.	O
</s>
<s>
Additionally	O
,	O
PS/2	B-Protocol
connectors	I-Protocol
only	O
insert	O
in	O
one	O
direction	O
and	O
must	O
be	O
rotated	O
correctly	O
before	O
attempting	O
connection	O
.	O
</s>
<s>
The	O
exact	O
direction	O
may	O
vary	O
on	O
older	O
or	O
non-ATX	O
computers	O
and	O
care	O
should	O
be	O
taken	O
to	O
avoid	O
damaged	O
or	O
bent	O
pins	O
when	O
connecting	O
devices	O
.	O
</s>
<s>
This	O
issue	O
is	O
slightly	O
alleviated	O
in	O
modern	O
times	O
with	O
the	O
advent	O
of	O
the	O
PS/2	B-Device
-to-USB	O
adapter	O
:	O
users	O
can	O
just	O
leave	O
a	O
PS/2	B-Protocol
connector	I-Protocol
plugged	O
into	O
the	O
PS/2	B-Device
-to-USB	O
adapter	O
at	O
all	O
times	O
and	O
not	O
risk	O
damaging	O
the	O
pins	O
this	O
way	O
.	O
</s>
<s>
A	O
USB-to-PS/2	O
adapter	O
does	O
not	O
have	O
this	O
problem	O
.	O
</s>
<s>
In	O
a	O
standard	O
implementation	O
both	O
PS/2	B-Protocol
ports	I-Protocol
are	O
usually	O
controlled	O
by	O
a	O
single	B-Device
microcontroller	I-Device
on	O
the	O
motherboard	O
.	O
</s>
<s>
The	O
resulting	O
problems	O
can	O
be	O
difficult	O
to	O
troubleshoot	O
(	O
e.g.	O
,	O
a	O
bad	O
mouse	O
can	O
cause	O
problems	O
that	O
appear	O
to	O
be	O
the	O
fault	O
of	O
the	O
keyboard	B-Device
and	O
vice	O
versa	O
)	O
.	O
</s>
