The Theory
Keyboard input is serial and fairly straight forward. 8 bits come in at a time with 1 parity bit and those 8 bits tell you what's going on. Here's a sample picture of what it looks like:
Scan Codes
Every key on the keyboard has a code. The table below gives some examples like '1C' is 'A'. The scan codes are how you can tell which key has been pressed on the keyboard. In a desktop there is usually a microcontroller on the motherboard that interprets this.
Our Implementation
To capture the data and make sense of it in VHDL we will have to use a special 'keyboard clock'. This is the clock we'll use to get the data to serially come into the CPLD. The keyboard entity will be seperate from the main 'Ball' entity so that it will plug right in.
Keyboard input is serial and fairly straight forward. 8 bits come in at a time with 1 parity bit and those 8 bits tell you what's going on. Here's a sample picture of what it looks like:
Scan Codes
Every key on the keyboard has a code. The table below gives some examples like '1C' is 'A'. The scan codes are how you can tell which key has been pressed on the keyboard. In a desktop there is usually a microcontroller on the motherboard that interprets this.
To capture the data and make sense of it in VHDL we will have to use a special 'keyboard clock'. This is the clock we'll use to get the data to serially come into the CPLD. The keyboard entity will be seperate from the main 'Ball' entity so that it will plug right in.