The processor in a keyboard has to understand several things that are important to the utility of the keyboard, such as:
• Position of the key in the key matrix.
• The amount of bounce and how to filter it.
• The speed at which to transmit the typematics.
• Position of the key in the key matrix.
• The amount of bounce and how to filter it.
• The speed at which to transmit the typematics.
The microprocessor and controller circuitry of a keyboard.
The key matrix is the grid of circuits underneath the keys. In all keyboards except for capacitive ones, each circuit is broken at the point below a specific key. Pressing the key bridges the gap in the circuit, allowing a tiny amount of current to flow through. The processor monitors the key matrix for signs of continuity at any point on the grid. When it finds a circuit that is closed, it compares the location of that circuit on the key matrix to the character map in its ROM. The character map is basically a comparison chart for the processor that tells it what the key at x,y coordinates in the key matrix represents. If more than one key is pressed at the same time, the processor checks to see if that combination of keys has a designation in the character map. For example, pressing the a key by itself would result in a small letter "a" being sent to the computer. If you press and hold down the Shift key while pressing the a key, the processor compares that combination with the character map and produces a capital letter "A."
A look at the key matrix.
The character map in the keyboard can
be superseded by a different character map provided by the computer.
This is done quite often in languages whose characters do not have
English equivalents. Also, there are utilities for changing the
character map from the traditional QWERTY to DVORAK or another custom
version.
Keyboards rely on switches that cause a change in the current flowing through the circuits in the keyboard. When the key presses the keyswitch against the circuit, there is usually a small amount of vibration between the surfaces, known as bounce. The processor in a keyboard recognizes that this very rapid switching on and off is not caused by you pressing the key repeatedly. Therefore, it filters all of the tiny fluctuations out of the signal and treats it as a single keypress.
If you continue to hold down a key, the processor determines that you wish to send that character repeatedly to the computer. This is known as typematics. In this process, the delay between each instance of a character can normally be set in software, typically ranging from 30 characters per second (cps) to as few as two cps.
Keyboards rely on switches that cause a change in the current flowing through the circuits in the keyboard. When the key presses the keyswitch against the circuit, there is usually a small amount of vibration between the surfaces, known as bounce. The processor in a keyboard recognizes that this very rapid switching on and off is not caused by you pressing the key repeatedly. Therefore, it filters all of the tiny fluctuations out of the signal and treats it as a single keypress.
If you continue to hold down a key, the processor determines that you wish to send that character repeatedly to the computer. This is known as typematics. In this process, the delay between each instance of a character can normally be set in software, typically ranging from 30 characters per second (cps) to as few as two cps.
Keyboard Technologies
Keyboards use a variety of switch
technologies. It is interesting to note that we generally like to have
some audible and tactile response to our typing on a keyboard. We want
to hear the keys "click" as we type, and we want the keys to feel firm
and spring back quickly as we press them. Let's take a look at these
different technologies:
• Rubber dome mechanical
• Capacitive non-mechanical
• Metal contact mechanical
• Membrane mechanical
• Foam element mechanical
• Rubber dome mechanical
• Capacitive non-mechanical
• Metal contact mechanical
• Membrane mechanical
• Foam element mechanical
This keyboard uses rubber dome switches.
Probably the most popular switch technology in use today is rubber dome. In these keyboards, each key sits over a small, flexible rubber dome with a hard carbon center. When the key is pressed, a plunger on the bottom of the key pushes down against the dome. This causes the carbon center to push down also, until it presses against a hard flat surface beneath the key matrix. As long as the key is held, the carbon center completes the circuit for that portion of the matrix. When the key is released, the rubber dome springs back to its original shape, forcing the key back up to its at-rest position.
Rubber dome switch keyboards are inexpensive, have pretty good tactile response and are fairly resistant to spills and corrosion because of the rubber layer covering the key matrix. Membrane switches are very similar in operation to rubber dome keyboards. A membrane keyboard does not have separate keys though. Instead, it has a single rubber sheet with bulges for each key. You have seen membrane switches on many devices designed for heavy industrial use or extreme conditions. Because they offer almost no tactile response and can be somewhat difficult to manipulate, these keyboards are seldom found on normal computer systems.
Capacitive switches are considered to be non-mechanical because they do not simply complete a circuit like the other keyboard technologies. Instead, current is constantly flowing through all parts of the key matrix. Each key is spring-loaded, and has a tiny plate attached to the bottom of the plunger. When a key is pressed, this plate is brought very close to another plate just below it. As the two plates are brought closer together, it affects the amount of current flowing through the matrix at that point. The processor detects the change and interprets it as a keypress for that location. Capacitive switch keyboards are expensive, but do not suffer from corrosion and have a longer life than any other keyboard. Also, they do not have problems with bounce since the two surfaces never come into actual contact.
Metal contact and foam element keyboards are not as common as they used to be. Metal contact switches simply have a spring-loaded key with a strip of metal on the bottom of the plunger. When the key is pressed, the metal strip connects the two parts of the circuit. The foam element switch is basically the same design but with a small piece of spongy foam between the bottom of the plunger and the metal strip, providing for a better tactile response. Both technologies have good tactile response, make satisfyingly audible "clicks" and are inexpensive to produce. The problem is that the contacts tend to wear out or corrode faster than on keyboards that use other technologies. Also, there is no barrier that prevents dust or liquids from coming in direct contact with the circuitry of the key matrix.
From the Keyboard to the Computer
As you type, the processor in the keyboard is analyzing the key matrix and determining what characters to send to the computer. It maintains these characters in a buffer of memory that is usually about 16 bytes large. It then sends the data in a stream to the computer via some type of connection.
The most common keyboard connectors are:
• 5-pin DIN (Deustche Industrie Norm) connector
• 6-pin IBM PS/2 mini-DIN connector
• 4-pin USB (Universal Serial Bus) connector
• internal connector (for laptops)
Normal DIN connectors are rarely used anymore. Most computers use the
mini-DIN PS/2 connector; but an increasing number of new systems are
dropping the PS/2 connectors in favor of USB. No matter which type of
connector is used, two principal elements are sent through the
connecting cable. The first is power for the keyboard. Keyboards
require a small amount of power, typically about 5 volts, in order to
function. The cable also carries the data from the keyboard to the
computer.
The other end of the cable connects to a port that is monitored by the computer's keyboard controller.
This is an integrated circuit (IC) whose job is to process all of the
data that comes from the keyboard and forward it to the operating
system. When the operating system is notified that there is data from
the keyboard, a number of things can happen:
• It checks to see if the keyboard data is a system level command. A good example of this is Ctrl+Alt+Delete on a Windows computer, which initiates a reboot.
• The operating system then passes the keyboard data on to the current application.
• The current application understands the keyboard data as an application-level command. An example of this would be Alt+f, which opens the File menu in a Windows application.
• The current application is able to accept keyboard data as content
for the application (anything from typing a document to entering a URL
to performing a calculation), or
• The current application does not accept keyboard data and therefore ignores the information.
Once the keyboard data is identified as either system-specific or
application-specific, it is processed accordingly. The really amazing
thing is how quickly all of this happens. As I type this article, there
is no perceptible time lapse between my fingers pressing the keys and
the characters appearing on my monitor. When you think about everything
the computer is doing to make each single character appear, it is
simply incredible!
A PS/2 type keyboard connector.