【正文】
s the steps the host must follow to send data to a PS/2 device: 1) Bring the Clock line low for at least 100 microseconds. 2) Bring the Data line low. 3) Release the Clock line. 4) Wait for the device to bring the Clock line low. 5) Set/reset the Data line to send the first data bit 6) Wait for the device to bring Clock high. 7) Wait for the device to bring Clock low. 8) Repeat steps 57 for the other seven data bits and the parity bit 9) Release the Data line. 10) Wait for the device to bring Data low. 11) Wait for the device to bring Clock low. 12) Wait for the device to release Data and Clock Figure 3 shows this graphically and Figure 4 separates the timing to show which signals are generated by the host, and which are generated by the PS/2 device. Notice the change in timing for the ack bitthe data transition occours when the Clock line is high (rather than when it is low as is the case for the other 11 bits.) Figure 3: HosttoDevice Communication. Figure 4: Detailed hosttodevice munication. Referring to Figure 4, there39。 channel B is the Data signal. The clock frequency is kHz. The time from the rising edge of a clock pulse to a Data transition must be at least 5 microseconds. The time from a data transition to the falling edge of a clock pulse must be at least 5 microseconds and no greater than 25 microseconds. The host may inhibit munication at any time by pulling the Clock line low for at least 100 microseconds. If a transmission is inhibited before the 11th clock pulse, the device must abort the current transmission and prepare to retransmit the current chunk of data when host releases Clock. A chunk of data could be a make code, break code, device ID, mouse movement packet, etc. For example, if a keyboard is interrupted while sending the second byte of a twobyte break code, it will need to retransmit both bytes of that break code, not just the one that was interrupted. If the host pulls clock low before the first hightolow clock transition, or after the falling edge of the last clock pulse, the keyboard/mouse does not need to retransmit any data. However, if new data is created that needs to be transmitted, it will have to be buffered until the host releases Clock. Keyboards have a 16byte buffer for this purpose. If more than 16 bytes worth of keystrokes occur, further keystrokes will be ignored until there39。s at a high log