Keyboard controller (computing)
   HOME

TheInfoList



OR:

In computing, a keyboard controller is a device that interfaces a
keyboard Keyboard may refer to: Text input * Keyboard, part of a typewriter * Computer keyboard ** Keyboard layout, the software control of computer keyboards and their mapping ** Keyboard technology, computer keyboard hardware and firmware Music * Musi ...
to a computer. Its main function is to inform the computer when a key is pressed or released. When data from the keyboard arrives, the controller raises an
interrupt In digital computers, an interrupt (sometimes referred to as a trap) is a request for the processor to ''interrupt'' currently executing code (when permitted), so that the event can be processed in a timely manner. If the request is accepted, ...
(a ''keyboard interrupt'') to allow the CPU to handle the input. If a keyboard is a separate peripheral system unit (such as in most modern desktop computers), the keyboard controller is not directly attached to the keys but receives
scancode A scancode (or scan code) is the data that most computer keyboards send to a computer to report which keys have been pressed. A number, or sequence of numbers, is assigned to each key on the keyboard. Variants Mapping key positions by row an ...
s from a microcontroller embedded in the keyboard via some kind of serial interface. In this case, the controller usually also controls the keyboard's LEDs by sending data back to the keyboard through the wire. In the 80s the
IBM PC AT The IBM Personal Computer/AT (model 5170, abbreviated as IBM AT or PC/AT) was released in 1984 as the fourth model in the IBM Personal Computer line, following the IBM PC/XT and its IBM Portable PC variant. It was designed around the Intel 80 ...
used an
Intel 8042 The MCS-48 microcontroller series, Intel's first microcontroller, was originally released in 1976. Its first members were 8048, 8035 and 8748. The 8048 is probably the most prominent member of the family. Initially, this family was produced u ...
chip to interface to the keyboard. This computer also controlled access to the
A20 line The A20, or address line 20, is one of the electrical lines that make up the system bus of an x86-based computer system. The A20 line in particular is used to transmit the 21st bit on the address bus. A microprocessor typically has a number o ...
in order to implement a workaround for a chip bug in the
Intel 80286 The Intel 80286 (also marketed as the iAPX 286 and often called Intel 286) is a 16-bit microprocessor that was introduced on February 1, 1982. It was the first 8086-based CPU with separate, non- multiplexed address and data buses and also the ...
. The keyboard controller was also used to initiate a software CPU reset in order to allow the CPU to transition from protected mode to real mode because the 286 did not allow the CPU to go from protected mode to real mode unless the CPU is reset. This was a problem because the BIOS and the operating system services could only be called by programs in real mode. These behaviors have been used by plenty of software that expects this behavior, and therefore keyboard controllers have continued controlling the A20 line and performing software CPU interrupts even when the need for a reset via the keyboard controller was obviated by the
Intel 80386 The Intel 386, originally released as 80386 and later renamed i386, is a 32-bit microprocessor introduced in 1985. The first versions had 275,000 transistorsPS/2 mouse input if a PS/2 mouse port is present. Today the keyboard controller is either a unit inside a
super I/O Super I/O is a class of I/O controller integrated circuits that began to be used on personal computer motherboards in the late 1980s, originally as add-in cards, later embedded on the motherboards. A super I/O chip combines interfaces for a vari ...
device or is missing, having the keyboard controller integrated in the USB keyboard itself, and its role in controlling the A20 line handled by the chipset.


IBM

* IBM plays a small role in the creation of the keyboard controller. With the IBM compatible computers, the keyboard controller or Intel 8042 keyboard controller is found on the motherboard. The controller handles input received from the computer keyboard, A20 lines, reset, deciphering scan codes, as well as the PS/2 mouse. With later models of keyboards, the 8042 was replaced with the 8742 micro-controller, which had a microprocessor, RAM, and I/O ports. * Anyone trying to use the classic 8042-style keyboard controller (KBC) found in the IBM PC/AT and nearly all later PCs typically runs into a problem with a lack of accurate documentation. The 8042 (or 8742, or any number of compatible parts built into later Super I/O chips) is actually quite well documented. The catch is that the 8042 is a programmable micro-controller with its own control software in (usually) ROM. Until recently, no one outside a few companies (IBM, AMI, Phoenix) knew exactly what the control software did. * IBM documented a number of commands the host can send to the KBC. It should be understood that all those commands are a pure software construct, with nothing about the 8042 hardware dictating that the commands need to follow any specific format, function, or that they even need to be there at all. Therefore, understanding the 8042 ROM code is the only way towards understanding exactly what the commands are and what they do, with the caveat that different controllers may and do have somewhat different code in their ROM.


List of KBC commands

The commands listed as “ignored” perform no function. * 00h–1Fh: Read KBC RAM indirect. Not documented. * 20h–3Fh: Read KBC RAM at offset 20h-3Fh. Only command 20h is documented by IBM. * 40h–5Fh: Write KBC RAM indirect. Not documented. * 60h–7Fh: Write KBC RAM at offset 20h-3Fh. Only command 60h is documented by IBM. The byte at offset 20h is the command byte and is treated specially. * 80h–A8h: Ignored. * AAh: Self test. This command is documented, but its side effects are not. * ABh: Interface test. * ACh: Diagnostic dump. Mentioned by third parties, but not documented by IBM. * ADh: Disable keyboard. * AEh: Enable keyboard. * AFh–BFh: Ignored. * C0h: Read input port. * C1h: Continuous input port poll, high nibble. Mentioned by third parties, but not documented by IBM. * C2h: Continuous input port poll, low nibble. Mentioned by third parties, but not documented by IBM. * C3h–CFh: Ignored. * D0h: Read output port. * D1h: Write output port. * D2h–DEh: Ignored. * E0h: Read test inputs. * E1h–EFh: Ignored. * F0h–FFh: Pulse output bits.


Conclusion

A portable computing device comprising:a keyboard controller having a first input for receiving keystroke inputs and having an output for conveying said keystroke inputs to a main processor; and a secondary processor having an interface to said keyboard controller through a secondary bus, said secondary bus also being used to communicate with a battery module, wherein said keyboard controller also conveys said keystroke inputs to said secondary processor through said secondary bus. The keyboard controller is programmed to support the IBM® compatible personal computer keyboard serial interface. The keyboard controller receives serial data from the keyboard, checks the parity of the data, translates the scan code, and presents the data to the system as a byte of data in its output buffer. The controller will interrupt the system when data is placed in its output buffer. The byte of data will be sent to the keyboard serially with an odd parity bit automatically inserted. The keyboard is required to acknowledge all data transmissions. No transmission should be sent to the keyboard until acknowledgment is received for the previous byte sent. The keyboard controller and BIOS to improve the performance of IBM PC machines and their compatibles. A hardwired methodology is used in this keyboard controller instead of a software implementation, as in the traditional 8042 keyboard BIOS. This enables the keyboard controller to respond instantly to all commands sent from the keyboard to the CPU BIOS. This enables popular programs such as Microsoft Windows, Novell, and other programs to run much faster.


See also

*
Keyboard buffer A keyboard buffer is a section of computer memory used to hold keystrokes before they are processed. Keyboard buffers have long been used in command-line processing. As a user enters a command, they see it echoed on their terminal and can edit i ...
*
AT keyboard The Model F was a series of computer keyboards produced mainly from 1981–1985 and in reduced volume until 1994 by IBM and later Lexmark. Its mechanical-key design consisted of a buckling spring over a capacitive PCB, similar to the later Model ...
*
KVM extender A KVM switch (with KVM being an abbreviation for "keyboard, video, and mouse") is a hardware device that allows a user to control multiple computers from one or more sets of keyboards, video monitors, and mice. Name Switches to connect mu ...
*
Embedded controller An Embedded Controller (EC) is a microcontroller in computers that handles various system tasks. Now it is usually merged with Super I/O, especially on mobile platforms (such as laptop). Tasks An embedded controller can have the following task ...


References


External links


keyboard controller - Computer Dictionary

KBD43W13 Keyboard and PS/2 Mouse Controller


{{DEFAULTSORT:Keyboard Controller (Computing) Computer keyboards