PS/2 Keyboard Interface

Project Info
Author: Chris
Difficulty: Easy-Medium
Time Invested: 1 Hour

Take a look at the above
articles before continuing
to read this article.
           The keyboard is the most common way for humans to input information into a computer. It has been around since before computers were main-stream and everyone was still using typewriters. Because of this prevalence in society, it's important that we understand how to interface to the basic PS/2 keyboard.
           This article will describe and show you an example of how to create a system capable of interacting with a keyboard in order to understand what keys have been pressed. The example system will be built on a breadboard using a PIC microcontroller to communicate with the keyboard and display output.

PS/2 Keyboard Interface - Demonstration

PS/2 Keyboard Interface - Setup

Purpose & Overview of this project
           The main goal here is to create a system that is capable of communicating with PS/2 devices, specifically the PS/2 keyboard. The PIC microcontroller will be connected to a PS/2 keyboard and it will receive keypress commands. Whenever a keypress is detected the PIC should output onto a 7-segment LED display which key was pressed.
           Since PS/2 is a serial communication protocol and the PS/2 keyboard controls the clock signal we will need to use the PIC's capture module interrupt to detect falling edges (ps/2 data is valid on falling edges). Additionally, some constant values will need to be progammed in to represent letters and numbers to display onto the 7-segment LED output display.