EE 316 Computer Engineering Junior Lab PS/2 Keyboard
The PS/2 Keyboard PS/2 device interface was developed by IBM. PS/2 port these days use the 6-pin mini-DIN connectors. The Data and clock are open-collector with pull-up resistors.
PS/2 Keyboard, contd.. PS/2 devices use bidirectional synchronous serial protocol. The device (keyboard in this case) generates the clock. The clock frequency is kHz. One byte of data is sent at a time. Each frame from keypad to the PC contains 11 bits. These bits are: 1 start bit. This is always 0. 8 data bits, least significant bit first. 1 Parity bit. 1 stop bit. This is always 1.
Scan code Keyboards consist of a large matrix of keys The keys are monitored or scanned by an on-board processor (aka the "keyboard encoder“). If a key is pressed, held and released, the keypad sends out an 11-bit “Scan code” (data). There are several scan codes. We will use the default code (See Scan code 2) for all modern keyboard.(See Scan code 2)
Keyboard to Host communication The “Make scan code” for Q Stop bit = = 0X15 <= The make scan code for the “Q” key Start bit = 0 Parity bit Keypad data is read on the Falling edge of the clock
References engineering.org/ps2protocol/ engineering.org/ps2protocol/ engineering.org/ps2keyboard/ engineering.org/ps2keyboard/ engineering.org/ps2keyboard/scancodes2.html engineering.org/ps2keyboard/scancodes2.html