Keyboard Controller - Construction and Working Of Keyboard Controller

Wednesday, December 12, 2012 , ,


What is Keyboard Controller?
Keyboard Controller is a an electronic device or IC chip that is used to interface keyboard with the computer or system. It is the main controlling device of keyboard. It reads signals coming from the keyboard matrix and interpret them according to the main program written in its memory. It has its own primary memory like ROM for storing programs. We can also re-program the ROM of the Keyboard controller if we need to.

But mostly these programs are pre-written by Product vendors. Before deeply digging into the construction and working of keyboard controller, first let us have a look at the working of the Basic Keyboard or Key switches. By reading this you will know how our pressed keys are acknowledged to the computer or how our computer knows that we pressed a key on the keyboard.
Also Read: Magnetron - Construction & Operation

Construction and Working of a Keyboard:
Basically, a keyboard consists of a matrix of rows and columns. The switches are fabricated on these matrices in such a away that when we press a specific key, a specific row and column got short circuited and this will let the keyboard controller know that which key is being pressed. The corresponding signals for those specific rows and columns are sent to keyboard controller. It processes that incoming signal and send the signal to the main CPU. Thus CPU gets the idea that which key is pressed and then display that specific key.

Construction and Working of Keyboard Controller:
Keyboard controllers usually comes in the form of IC chips. Most popular Keyboard controllers are Intel 8042 and Intel 8048. A keyboard controller consists of a RAM, ROM, Processor and some other Input/Output registers. The program, according to which, the controller works is saved in the ROM. RAM is used as a temporary storage for storing temporary variables or data. The construction diagram of Keyboard Controller is given below:
As we can see from the diagram. There are three main blocks of a keyboard controller. These are :
Also Read: Construction & Working Of TRIAC
  • Random Access Memory (RAM)
  • Read Only Memory (ROM)
  • Processor
Explanation of each block is given below:
Processor: The processor is used to convert the incoming Row-column signals into scan codes. These scan codes are then saved in the Output buffer. Then these scan codes are sent to the CPU or the system by the output buffer. The output buffer is a read only resister having size of 8 bits. If we keep key pressed for a long time (for example: more than half a second) then the processor also provides the feature to repeat the scan codes. The Keyboard having such ability is known as Type Matic Keyboards. Today, all keyboards have such facilities. This feature is also known as 'Auto Repeat Facility'.

There are two other buffers along side output buffer. These are :
  • Status register
  • Input Buffer Register
Status Register: As its name suggests it shows status of Keyboard controller to the main system or CPU. It is also an 8 bit register. It is read/write register. If main CPU wants to re-program the Keyboard Controller then it can send a control command to the status register.

Input Buffer Register: It is a register which contains both data and commands. It is an 8 bit Write only register. It have two input/output ports 60H and 64H. Port 60H is used for transmission of data, that is if any byte arrives through this port then it will be treated as data byte. The other Port 64H is used for commanding the controller. If a byte is received through this port then it will be treated as instruction or command.

Read Only Memory(ROM):As stated before, ROM chip is the primary memory of the Keyboard controller where the program is stored permanently. The Keyboard Controller works according to the program written in its memory i.e. Read Only Memory (ROM).