Hardware Reference
In-Depth Information
The keyboard in a PC is actually a computer. It communicates with the main system in one of two
ways:
• Through a special serial data link if a standard PS/2 keyboard connector is used
• Through the USB port
The serial data link used by conventional keyboards transmits and receives data in 11-bit packets of
information, consisting of 8 data bits, plus framing and control bits.
The processor in the original PC keyboard was an Intel 8048 microcontroller chip. Newer keyboards
often use an 8049 version that has built-in ROM or other microcontroller chips compatible with the
8048 or 8049. For example, in its Enhanced keyboards, IBM has always used a custom version of the
Motorola 6805 processor, which is compatible with the Intel chips. The keyboard's built-in
processor reads the key matrix, debounces the keypress signals, converts the keypress to the
appropriate scan code, and transmits the code to the motherboard. The processors built in to the
keyboard contain their own RAM, possibly some ROM, and a built-in serial interface.
In the original PC/XT design, the keyboard serial interface is connected to an 8255 Programmable
Peripheral Interface (PPI) chip on the motherboard of the PC/XT. This chip is connected to the
interrupt controller IRQ1 line, which signals to the system that keyboard data is available. The data is
then sent from the 8255 to the processor via input/output (I/O) port address 60h. The IRQ1 signal
causes the main system processor to run a subroutine (INT 9h) that interprets the keyboard scan code
data and decides what to do.
In an AT-type keyboard design, the keyboard serial interface is connected to a special keyboard
controller on the motherboard. This controller was an Intel 8042 Universal Peripheral Interface (UPI)
slave microcontroller chip in the original AT design. This microcontroller is essentially another
processor that has its own 2KB of ROM and 128 bytes of RAM. An 8742 version that uses erasable
programmable read-only memory (EPROM) can be erased and reprogrammed. In the past, when you
purchased a motherboard ROM upgrade for an older system from a motherboard manufacturer, the
upgrade included a new keyboard controller chip as well because it had somewhat dependent and
updated ROM code in it. Some older systems might use the 8041 or 8741 chips, which differ only in
the amount of built-in ROM or RAM. However, recent systems incorporate the keyboard controller
into the main system chipset.
When the keyboard controller on the motherboard receives data from the keyboard, it signals the
motherboard with an IRQ1 and sends the data to the main motherboard processor via I/O port address
60h. Acting as an agent between the keyboard and the main system processor, the 8042-type keyboard
controller can translate scan codes and perform several other functions. The system also can send
data to the 8042 keyboard controller via port 60h, which then passes it on to the keyboard.
Additionally, when the system needs to send commands to or read the status of the keyboard
controller on the motherboard, it reads or writes through I/O port 64h. These commands usually are
followed by data sent back and forth via port 60h.
The system also uses the 8042 keyboard controller to control the A20 memory address line, which
provides access to system memory greater than 1MB. More modern motherboards typically
incorporate this functionality directly into the motherboard chipset. The AT keyboard connector was
renamed the “PS/2” port after the IBM PS/2 family of systems debuted in 1987. That was when the
connector changed in size from the DIN to the mini-DIN, and even though the signals were the same,
the mini-DIN version became known from that time forward as the PS/2 port.
 
Search WWH ::




Custom Search