374USB键盘的兼容性问题

之前用374做的键盘输入设备用的一个USB键盘,后来坏掉了,新买了一个回来用,发现不能用了,用BUS HOUND分析,发现输入字母R输,码确不是一样的,如下: 原来OK的: 21 DI 00 00 00 15 00 00 00 00 ........ 22.1.0 00 . 22.1.8 21 STAK 03 00 00 e0 09 00 00 00 READ 22.2.0 00 00 00 00 00 00 00 00 22.2.8 00 00 00 00 b8 a7 e9 84 22.2.16 68 93 e2 84 a8 0d 30 f5 22.2.24

新买回来的(NG的,但在电脑上使用没有问题): 24 DI 03 00 00 20 00 00 00 00 ... .... 44.1.0 24 STAK 03 00 00 e0 08 00 00 00 READ 44.2.0 00 00 00 00 00 00 00 00 44.2.8 00 00 00 00 30 40 e9 84 44.2.16 a8 ec e8 84 a8 cd 7d f0 44.2.24

哪位有这方面的经验请指点一下方向,多谢!

附加上这个两个键盘一插上到按R键BUS HOUND的所有记录; OK的: Bus Hound 5.00 capture. Complements of www.perisoft.net

ok

Device - Device ID (followed by the endpoint for USB devices) (21) HID Keyboard Device (24) HID Keyboard Device Phase - Phase Type DI Data in DO Data out STAK NT IRP stack location Data - Hex dump of the data transferred Descr - Description of the phase Cmd... - Position in the captured data

Device Phase Data Description Cmd.Phase.Ofs(rep) ------ ----- ------------------------ ---------------- ------------------ 21 STAK 0e 00 00 00 0c 00 00 00 IOCTL 1.1.0 00 00 00 00 a8 01 0b 00 1.1.8 00 00 00 00 b8 a7 e9 84 1.1.16 00 00 00 00 00 00 00 00 1.1.24 21 STAK 0e 00 00 00 dc 01 00 00 IOCTL 2.1.0 00 00 00 00 93 01 0b 00 2.1.8 00 00 00 00 b8 a7 e9 84 2.1.16 00 00 00 00 00 00 00 00 2.1.24 21 STAK 1b 09 00 e0 a0 79 c4 f7 QUERY CAPS 3.1.0 00 00 00 00 00 00 00 00 3.1.8 00 00 00 00 b8 a7 e9 84 3.1.16 00 00 00 00 4e 84 ad f7 3.1.24 21 STAK 1b 09 00 00 24 7a c4 f7 QUERY CAPS 4.1.0 00 00 00 00 00 00 00 00 4.1.8 00 00 00 00 b8 a7 e9 84 4.1.16 00 00 00 00 00 00 00 00 4.1.24 21 STAK 1b 14 00 00 00 00 00 00 QUERY DEV STATE 5.1.0 00 00 00 00 00 00 00 00 5.1.8 00 00 00 00 b8 a7 e9 84 5.1.16 00 00 00 00 00 00 00 00 5.1.24 21 STAK 1b 07 00 00 00 00 00 00 QUERY RELATIONS 6.1.0(2) 00 00 00 00 00 00 00 00 6.1.8 00 00 00 00 b8 a7 e9 84 6.1.16 00 00 00 00 00 00 00 00 6.1.24 21 STAK 00 00 00 e0 08 79 c4 f7 CREATE 8.1.0 10 00 00 01 00 00 03 00 8.1.8 00 00 00 00 b8 a7 e9 84 8.1.16 68 93 e2 84 00 12 30 f5 8.1.24 21 STAK 03 00 00 e0 09 00 00 00 READ 9.1.0 00 00 00 00 00 00 00 00 9.1.8 00 00 00 00 b8 a7 e9 84 9.1.16 68 93 e2 84 a8 0d 30 f5 9.1.24 21 STAK 02 00 00 e0 00 00 00 00 CLOSE 10.1.0 00 00 00 00 00 00 00 00 10.1.8 00 00 00 00 b8 a7 e9 84 10.1.16 68 93 e2 84 4e 84 ad f7 10.1.24 21 STAK 0e 00 00 e0 04 00 00 00 IOCTL 11.1.0 04 00 00 00 40 41 29 00 11.1.8 00 00 00 00 b8 a7 e9 84 11.1.16 00 00 00 00 4c e0 50 80 11.1.24 21 STAK 00 00 00 e0 6c 78 c4 f7 CREATE 12.1.0 40 00 00 01 00 00 03 00 12.1.8 00 00 00 00 b8 a7 e9 84 12.1.16 68 93 e2 84 00 12 30 f5 12.1.24 21 STAK 03 00 00 e0 09 00 00 00 READ 13.1.0 00 00 00 00 00 00 00 00 13.1.8 00 00 00 00 b8 a7 e9 84 13.1.16 68 93 e2 84 a8 0d 30 f5 13.1.24 21 STAK 02 00 00 e0 00 00 00 00 CLOSE 14.1.0 00 00 00 00 00 00 00 00 14.1.8 00 00 00 00 b8 a7 e9 84 14.1.16 68 93 e2 84 4e 84 ad f7 14.1.24 21 STAK 0e 00 00 00 0c 00 00 00 IOCTL 15.1.0 00 00 00 00 a8 01 0b 00 15.1.8 00 00 00 00 b8 a7 e9 84 15.1.16 00 00 00 00 00 00 00 00 15.1.24 21 STAK 0e 00 00 00 dc 01 00 00 IOCTL 16.1.0 00 00 00 00 93 01 0b 00 16.1.8 00 00 00 00 b8 a7 e9 84 16.1.16 00 00 00 00 00 00 00 00 16.1.24 21 STAK 1b 08 00 00 3c d3 98 bf QUERY INTERFACE 17.1.0 14 00 01 00 38 3b 03 85 17.1.8 00 00 00 00 b8 a7 e9 84 17.1.16 00 00 00 00 00 00 00 00 17.1.24 21 STAK 00 00 00 e0 f0 76 a3 f7 CREATE 18.1.0 00 00 00 03 00 00 02 00 18.1.8 00 00 00 00 b8 a7 e9 84 18.1.16 68 93 e2 84 00 12 30 f5 18.1.24 21 STAK 1b 07 00 00 04 00 00 00 QUERY RELATIONS 19.1.0 00 00 00 00 00 00 00 00 19.1.8 00 00 00 00 b8 a7 e9 84 19.1.16 00 00 00 00 00 00 00 00 19.1.24 21 STAK 1b 07 00 00 04 00 00 00 QUERY RELATIONS 20.1.0 00 00 00 00 00 00 00 00 20.1.8 00 00 00 00 b8 a7 e9 84 20.1.16 68 93 e2 84 00 00 00 00 20.1.24 21 DO 00 01 .. 21.1.0 21 STAK 04 00 01 e0 02 00 00 00 WRITE 21.2.0 00 00 00 00 00 00 00 00 21.2.8 00 00 00 00 b8 a7 e9 84 21.2.16 68 93 e2 84 64 04 30 f5 21.2.24 21 DI 00 00 00 15 00 00 00 00 ........ 22.1.0 00 . 22.1.8 21 STAK 03 00 00 e0 09 00 00 00 READ 22.2.0 00 00 00 00 00 00 00 00 22.2.8 00 00 00 00 b8 a7 e9 84 22.2.16 68 93 e2 84 a8 0d 30 f5 22.2.24 21 DI 00 00 00 00 00 00 00 00 ........ 23.1.0 00 . 23.1.8 21 STAK 03 00 00 e0 09 00 00 00 READ 23.2.0


NG的: Bus Hound 5.00 capture. Complements of www.perisoft.net

ng

Device - Device ID (followed by the endpoint for USB devices) (21) HID Keyboard Device (24) HID Keyboard Device Phase - Phase Type DI Data in DO Data out STAK NT IRP stack location Data - Hex dump of the data transferred Descr - Description of the phase Cmd... - Position in the captured data

Device Phase Data Description Cmd.Phase.Ofs(rep) ------ ----- ------------------------ ---------------- ------------------ 21 STAK 0e 00 00 00 0c 00 00 00 IOCTL 1.1.0 00 00 00 00 a8 01 0b 00 1.1.8 00 00 00 00 30 60 e9 84 1.1.16 00 00 00 00 00 00 00 00 1.1.24 21 STAK 0e 00 00 00 44 02 00 00 IOCTL 2.1.0 00 00 00 00 93 01 0b 00 2.1.8 00 00 00 00 30 60 e9 84 2.1.16 00 00 00 00 00 00 00 00 2.1.24 21 STAK 1b 09 00 e0 a0 79 c4 f7 QUERY CAPS 3.1.0 00 00 00 00 00 00 00 00 3.1.8 00 00 00 00 30 60 e9 84 3.1.16 00 00 00 00 4e 84 ad f7 3.1.24 21 STAK 1b 09 00 00 24 7a c4 f7 QUERY CAPS 4.1.0 00 00 00 00 00 00 00 00 4.1.8 00 00 00 00 30 60 e9 84 4.1.16 00 00 00 00 00 00 00 00 4.1.24 21 STAK 1b 14 00 00 00 00 00 00 QUERY DEV STATE 5.1.0 00 00 00 00 00 00 00 00 5.1.8 00 00 00 00 30 60 e9 84 5.1.16 00 00 00 00 00 00 00 00 5.1.24 21 STAK 1b 07 00 00 00 00 00 00 QUERY RELATIONS 6.1.0 00 00 00 00 00 00 00 00 6.1.8 00 00 00 00 30 60 e9 84 6.1.16 00 00 00 00 00 00 00 00 6.1.24 24 STAK 0e 00 00 00 0c 00 00 00 IOCTL 7.1.0 00 00 00 00 a8 01 0b 00 7.1.8 00 00 00 00 30 40 e9 84 7.1.16 00 00 00 00 00 00 00 00 7.1.24 24 STAK 0e 00 00 00 0c 01 00 00 IOCTL 8.1.0 00 00 00 00 93 01 0b 00 8.1.8 00 00 00 00 30 40 e9 84 8.1.16 00 00 00 00 00 00 00 00 8.1.24 24 STAK 1b 09 00 e0 a0 79 c4 f7 QUERY CAPS 9.1.0 00 00 00 00 00 00 00 00 9.1.8 00 00 00 00 30 40 e9 84 9.1.16 00 00 00 00 4e 84 ad f7 9.1.24 24 STAK 1b 09 00 00 24 7a c4 f7 QUERY CAPS 10.1.0 00 00 00 00 00 00 00 00 10.1.8 00 00 00 00 30 40 e9 84 10.1.16 00 00 00 00 00 00 00 00 10.1.24 24 STAK 1b 14 00 00 00 00 00 00 QUERY DEV STATE 11.1.0 00 00 00 00 00 00 00 00 11.1.8 00 00 00 00 30 40 e9 84 11.1.16 00 00 00 00 00 00 00 00 11.1.24 24 STAK 1b 07 00 00 00 00 00 00 QUERY RELATIONS 12.1.0 00 00 00 00 00 00 00 00 12.1.8 00 00 00 00 30 40 e9 84 12.1.16 00 00 00 00 00 00 00 00 12.1.24 21 STAK 1b 07 00 00 00 00 00 00 QUERY RELATIONS 13.1.0 00 00 00 00 00 00 00 00 13.1.8 00 00 00 00 30 60 e9 84 13.1.16 00 00 00 00 00 00 00 00 13.1.24 24 STAK 1b 07 00 00 00 00 00 00 QUERY RELATIONS 14.1.0 00 00 00 00 00 00 00 00 14.1.8 00 00 00 00 30 40 e9 84 14.1.16 00 00 00 00 00 00 00 00 14.1.24 21 STAK 00 00 00 e0 08 b9 c5 f7 CREATE 15.1.0 10 00 00 01 00 00 03 00 15.1.8 00 00 00 00 30 60 e9 84 15.1.16 50 87 ee 84 00 d2 7d f0 15.1.24 21 STAK 03 00 00 e0 09 00 00 00 READ 16.1.0 00 00 00 00 00 00 00 00 16.1.8 00 00 00 00 30 60 e9 84 16.1.16 50 87 ee 84 a8 cd 7d f0 16.1.24 21 STAK 02 00 00 e0 00 00 00 00 CLOSE 17.1.0 00 00 00 00 00 00 00 00 17.1.8 00 00 00 00 30 60 e9 84 17.1.16 50 87 ee 84 4e 84 ad f7 17.1.24 21 STAK 0e 00 00 e0 04 00 00 00 IOCTL 18.1.0 04 00 00 00 40 41 29 00 18.1.8 00 00 00 00 30 60 e9 84 18.1.16 00 00 00 00 4c e0 50 80 18.1.24 21 STAK 00 00 00 e0 6c b8 c5 f7 CREATE 19.1.0 40 00 00 01 00 00 03 00 19.1.8 00 00 00 00 30 60 e9 84 19.1.16 50 87 ee 84 00 d2 7d f0 19.1.24 21 STAK 03 00 00 e0 09 00 00 00 READ 20.1.0 00 00 00 00 00 00 00 00 20.1.8 00 00 00 00 30 60 e9 84 20.1.16 50 87 ee 84 a8 cd 7d f0 20.1.24 21 STAK 02 00 00 e0 00 00 00 00 CLOSE 21.1.0 00 00 00 00 00 00 00 00 21.1.8 00 00 00 00 30 60 e9 84 21.1.16 50 87 ee 84 4e 84 ad f7 21.1.24 21 STAK 0e 00 00 00 0c 00 00 00 IOCTL 22.1.0 00 00 00 00 a8 01 0b 00 22.1.8 00 00 00 00 30 60 e9 84 22.1.16 00 00 00 00 00 00 00 00 22.1.24 21 STAK 0e 00 00 00 44 02 00 00 IOCTL 23.1.0 00 00 00 00 93 01 0b 00 23.1.8 00 00 00 00 30 60 e9 84


用CH374操作遇到的问题是什么呢?枚举失败、读取不到键值、还是其他问题呢?


可以控制LED灯亮,但读不到键值


(1)读不到键值与键值是什么内容没什么关系 (2)读不到键值,CH374的返回状态是什么?现在这个键盘的中断上传端点分析是否正确?


CH374的返回状态是32(20H)

键盘的中断上传端点分析是否正确------这个不清楚在哪里能看得到


你可以通过BUSHOUND抓取该键盘的描述符,然后在程序中监视下,看你获取的数据是否和抓取的数据一致即可.还有你索取数据的端点是不是该键盘的中断上传端点.


只有登录才能回复,可以选择微信账号登录