Mouse - Xilinx MIcroBlaze Development Spartan-3E 1600E Kit User Manual

Hide thumbs Also See for MIcroBlaze Development Spartan-3E 1600E Kit:
Table of Contents

Advertisement

Chapter 8: PS/2 Mouse/Keyboard Port
The keyboard sends data to the host in 11-bit words that contain a '0' start bit, followed by
eight bits of scan code (LSB first), followed by an odd parity bit and terminated with a '1'
stop bit. When the keyboard sends data, it generates 11 clock transitions at around 20 to
30 kHz, and data is valid on the falling edge of the clock as shown in

Mouse

A mouse generates a clock and data signal when moved; otherwise, these signals remain
High, indicating the Idle state. Each time the mouse is moved, the mouse sends three 11-bit
words to the host. Each of the 11-bit words contains a '0' start bit, followed by 8 data bits
(LSB first), followed by an odd parity bit, and terminated with a '1' stop bit. Each data
transmission contains 33 total bits, where bits 0, 11, and 22 are '0' start bits, and bits 10, 21,
and 32 are '1' stop bits. The three 8-bit data fields contain movement data as shown in
Figure
A PS/2-style mouse employs a relative coordinate system (see
moving the mouse to the right generates a positive value in the X field, and moving to the
left generates a negative value. Likewise, moving the mouse up generates a positive value
in the Y field, and moving it down represents a negative value. The XS and YS bits in the
status byte define the sign of each value, where a '1' indicates a negative value.
The magnitude of the X and Y values represent the rate of mouse movement. The larger the
value, the faster the mouse is moving. The XV and YV bits in the status byte indicate when
66
www.xilinx.com
8-4. Data is valid at the falling edge of the clock, and the clock period is 20 to 30 kHz.
Mouse status byte
1
0
L R
0
1 XS YS XV YV P
Stop bit
Start bit
Idle state
Start bit
Figure 8-4: PS/2 Mouse Transaction
-X values
(XS=1)
Figure 8-5: The Mouse Uses a Relative Coordinate System to Track Movement
X direction byte
1
0
X0 X1 X2 X3 X4 X5 X6 X7 P
Stop bit
Start bit
+Y values
(YS=0)
-Y values
(YS=1)
MicroBlaze Development Kit Spartan-3E 1600 Edition User Guide
Figure
8-2.
Y direction byte
1 0
Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 P
Stop bit
Idle state
Figure
8-5), wherein
+X values
(XS=0)
Mouse Arrow
UG257_08_05_060506
UG257 (v1.1) December 5, 2007
R
1
U257_08_04_060506

Advertisement

Table of Contents
loading

Table of Contents