PS/2 Keyboard To 16x2 LCD

Project Info
Author: Chris
Difficulty: Medium
Time Invested: 2 Hours

Take a look at the above
articles before continuing
to read this article.
           When it comes to input and output, the keyboard is the most common input device and the LCD is the most common output device. Understanding how to use both of them together is vital for any designer who wants to make a system anyone can use.
           This article will further build upon the PS/2 Keyboard Interface design by modifying the PS/2 interface so that output is displayed onto a 16x2 LCD. We are not looking to do anything fancy yet, just a simple input and output system. This article will quickly explain PS/2 theory and then focus on how to build a PS/2 Keyboard to 16x2 LCD interface.

PS/2 Keyboard To 16x2 LCD - Demonstration

PS/2 Keyboard To 16x2 LCD - Setup

PS/2 Keyboard To 16x2 LCD - Main Board

Purpose & Overview of this project
           Our goal for this system is to make it so that when any key A-Z or number 0-9 is pressed, it should display on the LCD. Similarly, if the backspace key is pressed the cursor should move back one space. If the delete key is pressed, the entire row of text should be deleted and the cursor moved to the home position.
           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). After we know what key is pressed we will use a large switch statement to map scancodes to the letters/numbers on the keyboard. The last step will be printing the keys onto the LCD. To save time when building the system, the LCD should be used in 4-bit mode.