-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeyboard-Protocol
More file actions
5 lines (3 loc) · 1.18 KB
/
Keyboard-Protocol
File metadata and controls
5 lines (3 loc) · 1.18 KB
1
2
3
4
5
The ps2 keyboard controller is very simple. It recieves a signal (the make code) from the keyboard, and stores it. It ignores other types of incoming signals from the keyboard, and when storing a make code, ignores other make codes. Thus, there is no buffering of keystrokes, and the system must keep constantly polling the controller if it wishes to capture multiple keystrokes.
The controller communicates that it has a keystroke waiting by asserting the "Ready" line. If the keyboard controller receives the chip select signal, but has no keystrokes to report, it will simply fail to assert the ready signal.
If a keystroke is waiting to be received, then the CPU must assert the "read" signal. When the read signal is first asserted, the keyboard controller presents the upper nibble of the key code on the data lines. This happens faster than the CPU can cycle; no need to wait. The CPU can then grab the data, and deassert the read line. On a second assertion, the keyboard controller presents the lower nibble of the key code. Once the CPU deasserts the read line for a second time, the keyboard controller stops asserting the ready signal, and does not raise it again until it receives a new keystroke.