Digital Signal Processing Reference
In-Depth Information
11.4 The PS/2 Serial Data Transmission Protocol
The scan codes are sent serially using 11 bits on the bi-directional data line.
When neither the keyboard nor the computer needs to send data, the data line
and the clock line are High (inactive).
As seen in Figure 11.1, the transmission of a single key or command consists of
the following components:
1. A start bit ('0')
2. 8 data bits containing the key scan code in low to high bit order
3. Odd parity bit such that the eight data bits plus the parity bit are an odd
number of ones
4. A stop bit ('1')
The following sequence of events occur during a transmission of a command by
the keyboard:
1. The keyboard checks to ensure that both the clock and keyboard lines are
inactive. Inactive is indicated by a High state. If both are inactive, the keyboard
prepares the 'start' bit by dropping the data line Low.
2. The keyboard then drops the clock line Low for approximately 35us.
3. The keyboard will then clock out the remaining 10 bits at an approximate
rate of 70us per clock period. The keyboard drives both the data and clock line.
4. The computer is responsible for recognizing the 'start' bit and for receiving
the serial data. The serial data, which is 8 bits, is followed by an odd parity bit
and finally a High stop bit. If the keyboard wishes to send more data, it follows
the 12th bit immediately with the next 'start' bit.
This pattern repeats until the keyboard is finished sending data at which point
the clock and data lines will return to their inactive High state.
Clock
Data
0 1 1 0 1 0 0 0
Start
Bit=0
Odd Parity
Bit=0
Stop
Bit=1
8 Data Bits in Low to High Order
Scan Code shown is 16H for a “1” character
which is keyboard key #2
Figure 11.1 Keyboard Transmission of a Scan Code.
Search WWH ::




Custom Search