19.3 Keyboard Interfaces
Keyboard interfaces are well standardized, and have been for years. This means that, with the exception of antique PC and PC/XT keyboards, you can plug any keyboard into any PC to which it can physically connect and expect it to work. The following sections detail the three keyboard interfaces currently in use.
19.3.1 AT Keyboard Interface
The AT keyboard interface was introduced with the IBM PC/AT in 1984, and is still used by current production AT and BAT motherboards. AT keyboards use the 5-pin DIN connector (female at the PC), shown in Figure 19-1 and whose pinouts are described in Table 19-1. On the PC side, the AT keyboard uses an Intel 8042 or equivalent interface chip, which is assigned IRQ1 and I/O base address 0060.
Figure 19-1. The AT keyboard connector
The pin descriptions are self-explanatory, other than pin 3. The 83-key IBM PC/XT keyboard and some 84-key IBM PC/AT keyboards used an early keyboard protocol that did not include a software reset command. For these keyboards, the PC uses pin 3 to send a hardware reset to the keyboard. All systems and keyboards made in the last fifteen years use a keyboard protocol that includes a software reset command, and nearly all recent keyboards leave pin 3 unconnected.
19.3.2 PS/2 Keyboard Interface
The PS/2 keyboard interface was introduced with the IBM PS/2 series in 1986, and is now used by all ATX and ATX-variant motherboards. PS/2 keyboards use the 6-pin mini-DIN connector (female at the PC), shown in Figure 19-2 and whose pinouts are described in Table 19-2. On the PC side, the PS/2 keyboard uses the same Intel 8042 or equivalent interface chip as the AT keyboard, which is also assigned IRQ1 and I/O base address 0060.
Figure 19-2. The PS/2 keyboard connector
The AT and PS/2 keyboard interfaces use incompatible connectors, but are electrically and functionally identical. You can connect an AT keyboard to a PS/2 keyboard port or vice versa by building or buying an adapter that uses the pinouts listed in Table 19-3. Many new keyboards come with an adapter to allow their use with the other style connector. Such adapters can also be purchased at most computer stores.
19.3.3 USB Keyboard Interface
Some recent keyboards can be connected to a USB port. For now at least, few keyboards are USB-only. Most USB-capable keyboards also provide a standard PS/2 connector, via either a split cable with both USB and PS/2 connectors or a separate adapter that converts the USB connector to PS/2. To use a USB keyboard, the PC BIOS must support USB keyboards, and you must run an operating system, like Windows 98/98SE/Me or Windows 2000/XP, that supports USB. BIOS support is needed so that the keyboard can be used before the operating system loads to do such things as changing Setup parameters or choosing options from a boot menu. Operating system support is required for the keyboard to be accessible after the system boots.