CURRENT ISSUE
Contests
Feature Article
|
|
Issue #201 April 2007
ATir Keyboard Interface
by Steven Savage
Start | System Overview | Keyboard | IR Remote Operation | ATir Hardware | Operation | Nice Solution | Sources & PDF
Keyboard
The AT keyboard is configured with a five-pin DIN connector or a six-pin
mini-DIN (commonly referred to as PS2) connector. The interface comprises
four wires (i.e., 5 V ground, clock, and data). The clock and data lines
implement a bidirectional synchronous serial bus. The bidirectional nature
of the bus allows the PC to send select messages to the keyboard such
as, retransmit the last byte, or turn on the Caps Lock LED, as well as
the normal traffic from the keyboard to the PC.
Key press information is transmitted in the form of a scan code. For example, the A key sends a code of 0x1C when pressed and 0xF0 0x1C when released. The key press and key release are coded separately to allow multiple keys to be pressed simultaneously (such as when using the Shift key to type a capital letter). The format for a scan code is an 11-bit frame, consisting of a start bit, 8-bit code, odd parity bit, and stop bit. The frame-timing diagram for keyboard to PC (host) communication is shown in Figure 3a. PC-to-keyboard communications is initiated by the PC by placing the bus in a “request to send condition,” which signals the keyboard to clock in the command. This communication is shown in Figure 3b.
|
a)
b) |
| Figure 3a—As you may expect, the majority of communication is from the keyboard to the PC. The keyboard generates the clock signal and data is sent in an 11-bit frame. b—Yes, the PC can actually send data to the keyboard (such as turning on the Caps Lock LED). The keyboard generates the clock signal regardless of the direction of dataflow |
|
