Xilinx UG230 Spartan-3E FPGA Starter Kit Board User Guide
Xilinx UG230 Spartan-3E FPGA Starter Kit Board User Guide
Xilinx UG230 Spartan-3E FPGA Starter Kit Board User Guide
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
ESC<br />
76<br />
` ~<br />
0E<br />
TA B<br />
0D<br />
Caps Lock<br />
58<br />
Shift<br />
12<br />
Ctrl<br />
14<br />
R<br />
1 !<br />
16<br />
Q<br />
15<br />
F1<br />
05<br />
2 @<br />
1E<br />
W<br />
1D<br />
A<br />
1C<br />
Z<br />
1Z<br />
F2<br />
06<br />
3 #<br />
26<br />
S<br />
1B<br />
Alt<br />
11<br />
E<br />
24<br />
X<br />
22<br />
F3<br />
04<br />
4 $<br />
25<br />
D<br />
23<br />
R<br />
2D<br />
C<br />
21<br />
F4<br />
0C<br />
5 %<br />
2E<br />
F<br />
2B<br />
T<br />
2C<br />
V<br />
2A<br />
6 ^<br />
36<br />
F5<br />
03<br />
Y<br />
35<br />
G<br />
34<br />
B<br />
32<br />
7 &<br />
3D<br />
Figure 8-3: PS/2 Keyboard Scan Codes<br />
Keyboard<br />
The host can also send commands and data to the keyboard. Table 8-3 provides a short list<br />
of some often-used commands.<br />
Table 8-3: Common PS/2 Keyboard Commands<br />
H<br />
33<br />
F6<br />
0B<br />
U<br />
3C<br />
N<br />
31<br />
Space<br />
29<br />
The keyboard sends commands or data to the host only when both the data and clock lines<br />
are High, the Idle state.<br />
Because the host is the bus master, the keyboard checks whether the host is sending data<br />
before driving the bus. The clock line can be used as a clear to send signal. If the host pulls<br />
the clock line Low, the keyboard must not send any data until the clock is released.<br />
The keyboard sends data to the host in 11-bit words that contain a ‘0’ start bit, followed by<br />
eight bits of scan code (LSB first), followed by an odd parity bit and terminated with a ‘1’<br />
stop bit. When the keyboard sends data, it generates 11 clock transitions at around 20 to<br />
30 kHz, and data is valid on the falling edge of the clock as shown in Figure 8-2.<br />
<strong>Spartan</strong>-<strong>3E</strong> <strong>FPGA</strong> <strong>Starter</strong> <strong>Kit</strong> <strong>Board</strong> <strong>User</strong> <strong>Guide</strong> www.xilinx.com 65<br />
<strong>UG230</strong> (v1.2) January 20, 2011<br />
8 *<br />
<strong>3E</strong><br />
J<br />
3B<br />
F7<br />
83<br />
M<br />
3A<br />
I<br />
43<br />
9 (<br />
46<br />
K<br />
42<br />
F8<br />
0A<br />
O<br />
44<br />
, <<br />
41<br />
Command Description<br />
0 )<br />
45<br />
L<br />
4B<br />
P<br />
4D<br />
> .<br />
49<br />
F9<br />
01<br />
- _<br />
4E<br />
; :<br />
4C<br />
/ ?<br />
4A<br />
[ {<br />
54<br />
Alt<br />
E0 11<br />
F10<br />
09<br />
= +<br />
55<br />
' "<br />
52<br />
] }<br />
5B<br />
F11<br />
78<br />
Back Space<br />
66<br />
\ |<br />
5D<br />
Enter<br />
5A<br />
Shift<br />
59<br />
F12<br />
07 E0 75<br />
Ctrl<br />
E0 14<br />
E0 74<br />
E0 6B<br />
E0 72<br />
<strong>UG230</strong>_c8_03_021806<br />
ED Turn on/off Num Lock, Caps Lock, and Scroll Lock LEDs. The keyboard acknowledges receipt of an<br />
“ED” command by replying with an “FA”, after which the host sends another byte to set LED status. The<br />
bit positions for the keyboard LEDs are shown below. Write a ‘1’ to the specific bit to illuminate the<br />
associated keyboard LED.<br />
7 6 5 4 3 2 1 0<br />
EE Echo. Upon receiving an echo command, the keyboard replies with the same scan code “EE”.<br />
F3 Set scan code repeat rate. The keyboard acknowledges receipt of an “F3” by returning an “FA”, after<br />
which the host sends a second byte to set the repeat rate.<br />
FE Resend. Upon receiving a resend command, the keyboard resends the last scan code sent.<br />
FF Reset. Resets the keyboard.<br />
Ignored Caps Lock Num Lock Scroll Lock