Keyboard - Xilinx Spartan-3 User Manual

Starter kit board
Table of Contents

Advertisement

R
bidirectional keyboard communications. As shown in
mouse writes a bit on the data line when the clock signal is High, and the host reads the
data line when the clock signal is Low.
Table 6-2: PS/2 Bus Timing
The following site contains additional information on the PS/2 bus protocol:

Keyboard

The keyboard uses open-collector drivers so that either the keyboard or the host can drive
the two-wire bus. If the host never sends data to the keyboard, then the host can use simple
input pins.
A PS/2-style keyboard uses scan codes to communicate key press data. Nearly all
keyboards in use today are PS/2 style. Each key has a single, unique scan code that is sent
whenever the corresponding key is pressed. The scan codes for most keys appear in
Figure
If the key is pressed and held, the keyboard repeatedly sends the scan code every 100 ms or
so. When a key is released, the keyboard sends a "F0" key-up code, followed by the scan
code of the released key. The keyboard sends the same scan code, regardless if a key has
different "shift" and "non-shift" characters and regardless whether the Shift key is pressed
or not. The host determines which character is intended.
Some keys, called extended keys, send an "E0" ahead of the scan code and furthermore,
they may send more than one scan code. When an extended key is released, a "E0 F0" key-
up code is sent, followed by the scan code.
28
Symbol
T
Clock High or Low time
CK
T
Data-to-clock setup time
SU
T
Clock-to-data hold time
HLD
CLK (PS2C)
DATA (PS2D)
Figure 6-2: PS/2 Bus Timing Waveforms
PS/2 Mouse/Keyboard Protocol
http://panda.cs.ndsu.nodak.edu/~achapwes/PICmicro/PS2/ps2.htm
6-3.
www.xilinx.com
1-800-255-7778
Chapter 6: PS/2 Mouse/Keyboard Port
Figure
Parameter
T
T
CK
CK
Edge 0
T
HLD
T
SU
'1' stop bit
'0' start bit
Spartan-3 Starter Kit Board User Guide
6-2, the attached keyboard or
Min
Max
30 µs
50 µs
5 µs
25 µs
5 µs
25 µs
Edge 10
UG130_c6_02_042404
UG130 (v1.1) May 13, 2005

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Spartan-3 fpga

Table of Contents