1 | XT keyboard protocol and signalling
|
---|
2 | ===================================
|
---|
3 |
|
---|
4 | The keyboard comnmunicates with the PC/XT through a mostly single-direction
|
---|
5 | serial link.
|
---|
6 |
|
---|
7 | When the link is idle, the CLK line is high (floating), and the DATA line is
|
---|
8 | low (pulled by the keyboard).
|
---|
9 |
|
---|
10 | When the keyboard wants to send a byte:
|
---|
11 | - It checks that the CLK line is not pulled low (the PC/XT does this when the
|
---|
12 | receiving buffer is full).
|
---|
13 | - It sends the byte for the keycode. There is a start bit (DATA=1), followed by
|
---|
14 | the 7-bit keycode (LSb first), and the make/break bit (set for release, clear
|
---|
15 | for key press).
|
---|
16 |
|
---|
17 | As the 9th bit is pushed, the PC will force the clock line low until the CPU has
|
---|
18 | read the received byte and cleared the receiving register.
|
---|
19 |
|
---|
20 | The PC stores the data on the falling edge of the clock. It can also reset the
|
---|
21 | keyboard by pulling the clock line low for too long (unsure what the exact
|
---|
22 | timing is).
|
---|
23 |
|
---|
24 | It is up to the keyboard to manage the states of the LEDs. At power on, the LEDs
|
---|
25 | are off. They are switched by pressing CAPS and NUM locks. It's possible that
|
---|
26 | they get out of sync with the caps/num state the computer has. It is also up to
|
---|
27 | the keyboard to handle typematic (key repeat) and a keyboard buffer, if needed.
|
---|
28 |
|
---|
29 | At boot, the keyboard is supposed to send 0xAA when it is ready to work.
|
---|
30 | However, I'm not sure my XT clone BIOS actually checks for that.
|
---|