
VIA Technologies, Inc.
VT82C42
-2-
The host can program the output port (P20-P23 in AT mode, or P20-P21 in PS/2 mode) or in-out port (P10-
P15 in AT mode, or P12-P15 in PS/2 mode) by issuing a command to the command register on the VT82C42.
The controller will then quickly execute the specified command. Note that P16-P17 is implemented as an
input port only. The host can also transmit data to the keyboard and mouse by issuing a command to the data
register. The data coming to the data register (with A0 = 0, CS# = 0, RD# = 1, and WR# = 0) will be sent to
the keyboard via the keyboard serial interfaces. The data sent to the mouse will be completed by 1) issuing a
D4 command to the command register, 2) then writing the following data byte to the data register (to be sent to
the mouse via mouse serial interface). In either case, the VT82C42 will wait for an acknowledgement from the
keyboard or mouse to complete a transmission. At the same time as the completion of the transmission, the
VT82C42 will raise P24 or P25 (when sending data to mouse) to signal the host of a completion of
transmission. When the controller receives or transmits, the controller does a parity and time-out check. If any
error occurs in the interface or inside the external devices (keyboard or mouse), the controller will reflect that
error in the following status register.
A0
CS
IOR
IOW
command
decoder
+
scan
mapping
data input buffer
command register/
data register
data output buffer
status register
arbitration &
central control
unit
timer
X1, X2
D[7:0]
receiving unit
transmtting unit
d
clocking
(8 Mhz)
In/Out
port buffer
KBCK
KBDT
MSCK
MSDT
P[17:10]
P[27:20]
RESET
mode
selector
T1
T0
Fig 1. Block Diagram for VT82C42