R
Chapter 6: PS/2 Mouse/Keyboard Port
The following site contains more information on PS/2 keyboard interfaces:
?
The PS/2 Keyboard Interface
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 6-4 . Data is valid at the falling edge of the clock, and the clock period is 20 to 30 kHz.
Mouse status byte
X direction byte
Y direction byte
1
0
L
R
0
1 XS YS XV YV P
1
0 X0 X1 X2 X3 X4 X5 X6 X7 P
1
0 Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 P
1
Idle state
Start bit
Stop bit
Start bit
Stop bit
Start bit
Stop bit
Idle state
UG130_c6_04_042404
Figure 6-4: PS/2 Mouse Transaction
As shown in Figure 6-5 , a PS/2 mouse employs a relative coordinate system wherein
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 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.
+Y values (YS=0)
-X values
(XS=1)
-Y values (YS=1)
+X values
(XS=0)
UG130_c6_05_042404
Figure 6-5:
The Mouse Uses a Relative Coordinate System to Track Movement
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
the X or Y values exceed their maximum value, an overflow condition. A ‘1’ indicates when
30
Spartan-3 FPGA Starter Kit Board User Guide
UG130 (v1.2) June 20, 2008
相关PDF资料
HW-SPAR3E-DISP-DK-UNI-G KIT DEV SPARTAN3E DISPLAY
HW-SPAR3E-SK-UK-G KIT STARTER SPARTAN-3E
HW-USB-II-G PLATFORM CABLE USB II
HW-USBN-2A ACCY USB DOWNLOAD CABLE STD SPD
HW-V4-ML401-USA EVALUATION PLATFORM VIRTEX-4
HW-V4-ML423-UNI-G EVALUATION PLATFORM VIRTEX-4
HW-V4SX35-VIDEO-SK-UK VIRTEX-4 VIDEO STARTER KIT
HW-V5-ML521-UNI-G EVALUATION PLATFORM VIRTEX-5
相关代理商/技术参数
HW-T126 制造商:IDEC Corporation 功能描述:120V/6V Xfrmr w/G Trmnls
HW-T246 制造商:IDEC CORPORATION 功能描述:240V/6V Xfrmr w/G Trmnls
HWT9/17 制造商:Talco Tool Storage 功能描述:9 TRAY CANTILEVER TOOLBOX
HW-USB-1A 功能描述:程序设计器配件 ispDOWNLOAD Cable - USB CONNECTION RoHS:否 制造商:Lattice 产品:ispDOWNLOAD Cables 用于:In-system Programming
HW-USB-2A 功能描述:程序设计器配件 ispDOWNLOAD Cable USB Connection RoHS:否 制造商:Lattice 产品:ispDOWNLOAD Cables 用于:In-system Programming
HW-USB-FLYLEADS-G 功能描述:BOARD ADAPTER AND FLY LEADS RoHS:是 类别:编程器,开发系统 >> 配件 系列:- 标准包装:1 系列:- 附件类型:适配器板 适用于相关产品:RCB230,RCB231,RCB212 配用:26790D-ND - RCB BREAKOUT BOARD RS232 CABLE
HW-USB-G 功能描述:PLATFORM CABLE USB RoHS:是 类别:编程器,开发系统 >> 过时/停产零件编号 系列:- 标准包装:1 系列:- 传感器类型:CMOS 成像,彩色(RGB) 传感范围:WVGA 接口:I²C 灵敏度:60 fps 电源电压:5.7 V ~ 6.3 V 嵌入式:否 已供物品:成像器板 已用 IC / 零件:KAC-00401 相关产品:4H2099-ND - SENSOR IMAGE WVGA COLOR 48-PQFP4H2094-ND - SENSOR IMAGE WVGA MONO 48-PQFP
HW-USB-IIG 制造商:Xilinx 功能描述:CABLE PROGRAM & CONFIG USB 制造商:Xilinx 功能描述:PLATFORM CABLE, CONFIGURATION/PROG 制造商:Xilinx 功能描述:PROGRAMMER, IN CIRCUIT, PLATFORM CONFIG AND PROG; Silicon Family Name:Virtex II, Spartan II; Core Architecture:FPGA; Core Sub-Architecture:Virtex, Spartan, XC4000; IC Product Type:Programmer, In-Circuit; Supply Voltage:5.25V ;RoHS Compliant: Yes