EE 316 Computer Engineering Junior Lab PS2 Keyboard
EE 316 Computer Engineering Junior Lab PS/2 Keyboard
The PS/2 Keyboard n n n 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. http: //www. computer-engineering. org/ps 2 protocol/
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 10 -16. 7 k. Hz. 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. http: //www. computer-engineering. org/ps 2 protocol/
Scan code n n 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. http: //www. computer-engineering. org/ps 2 keyboard/
Keyboard to Host communication The “Make scan code” for Q 0 1 0 1 0 0 Keypad data is read on the Falling edge of the clock Start bit = 0 0001 0101 = 0 X 15 <= The make scan code for the “Q” key http: //www. computer-engineering. org/ps 2 protocol/ Stop bit = 1 Parity bit
References n n n http: //www. computerengineering. org/ps 2 protocol/ http: //www. computerengineering. org/ps 2 keyboard/scancodes 2. html
- Slides: 6