
9,$7HFKQRORJLHV,QF
VT82C586B
Revision 1.0
May 13, 1997
-
22-
Register Descriptions
Keyboard Controller Registers
The keyboard controller handles the keyboard and mouse
interfaces. Two ports are used: port 60 and port 64. Reads
from port 64 return a status byte. Writes to port 64h are
command codes (see command code list following the register
descriptions). Input and output data is transferred via port 60.
A “Control” register is also available. It is accessable by
writing commands 20h / 60h to the command port (port 64h);
The control byte is written by first sending 60h to the
command port, then sending the control byte value. The
control register may be read by sending a command of 20h to
port 64h, waiting for “Output Buffer Full” status = 1, then
reading the control byte value from port 60h.
Traditional (non-integrated) keyboard controllers have an
“Input Port” and an “Output Port” with specific pins dedicated
to certain functions and other pins available for general
purpose I/O. Specific commands are provided to set these pins
high and low. All outputs are “open-collector” so to allow
input on one of these pins, the output value for that pin would
be set high (non-driving) and the desired input value read on
the input port. These ports are defined as follows:
Bit
0
1
2
3
4
5
6
7
Bit
0
1
2
3
4
5
6
7
Bit Test Port
0
T0 - Keyboard Clock In
1
T1 - Mouse Clock In
Note: Command code C0h transfers input port data to the
output buffer. Command code D0h copies output port values
to the output buffer. Command code E0h transfers test input
port data to the output buffer.
Input Port
P10 - Keyboard Data In
P11 - Mouse Data In
P12 - Turbo Pin (PS/2 mode only)
P13 - user-defined
P14 - user-defined
P15 - user-defined
P16 - user-defined
P17 - undefined
Output Port
P20 - SYSRST (1=execute reset)
P21 - GATEA20 (1=A20 enabled)
P22 - Mouse Data Out
P23 - Mouse Clock Out
P24 - Keyboard OBF Interrupt (IRQ1) –
P25 - Mouse OBF Interrupt (IRQ 12) –
P26 - Keyboard Clock Out
P27 - Keyboard Data Out
Lo Code Hi Code
B0
B1
B2
B3
B6
B7
–
–
Lo Code Hi Code
–
–
B4
B5
B8
B9
BA
BB
BE
BF
–
–
–
–
BC
BD
–
–
–
–
–
–
Lo Code Hi Code
–
–
–
–
Port 60 - Keyboard Controller Input Buffer ................. WO
Only write to port 60h if port 64h bit-1 = 0 (1=full).
Port 60 - Keyboard Controller Output Buffer ................ RO
Only read from port 60h if port 64h bit-0 = 1 (0=empty).
Port 64 - Keyboard / Mouse Status .................................. RO
0
Keyboard Output Buffer Full
0
Keyboard Output Buffer Empty.............default
1
Keyboard Output Buffer Full
1
Input Buffer Full
0
Input Buffer Empty................................default
1
Input Buffer Full
2
System Flag
0
Power-On Default..................................default
1
Self Test Successful
3
Command / Data
0
Last write was data write .......................default
1
Last write was command write
4
Keylock Status
0
Locked
1
Free
5
Mouse Output Buffer Full
0
Mouse output buffer empty....................default
1
Mouse output buffer holds mouse data
6
General Receive / Transmit Timeout
0
No error .................................................default
1
Error
7
Parity Error
0
No parity error (odd parity received).....default
1
Even parity occurred on last byte received
from keyboard / mouse
KBC Control Register .......... (R/W via Commands 20h/60h)
7
Reserved
........................................always reads 0
6
PC Compatibility
0
Disable scan conversion
1
Convert scan codes to PC format; convert 2-
byte break sequences to 1-byte PC-compatible
break codes............................................default
5
Mouse Disable
0
Enable Mouse Interface.........................default
1
Disable Mouse Interface
4
Keyboard Disable
0
Enable Keyboard Interface....................default
1
Disable Keyboard Interface
3
Keyboard Lock Disable
0
Enable Keyboard Inhibit Function.........default
1
Disable Keyboard Inhibit Function
2
System Flag
................................................default=0
This bit may be read back as status register bit-2
1
Mouse Interrupt Enable
0
Disable mouse interrupts .......................default
1
Generate interrupt on IRQ12 when mouse data
comes in output bufer
0
Keyboard Interrupt Enable
0
Disable Keyboard Interrupts..................default
1
Generate interrupt on IRQ1 when output buffer
has been written.