USB 鍵盤枚舉問題

Bus Hound 6.01 capture on Windows Vista Service Pack 1 (x64). Complements of www.perisoft.net

Device - Device ID (followed by the endpoint for USB devices) (16) USB Composite Device (19) USB 輸入設(shè)備 (20) USB 輸入設(shè)備 (21) HID Keyboard Device (22) 符合 HID 標(biāo)準(zhǔn)的用戶控制設(shè)備 (23) HID-compliant device (24) USB Composite Device (25) USB Audio DAC (26) USB 輸入設(shè)備 (27) 符合 HID 標(biāo)準(zhǔn)的用戶控制設(shè)備 Phase - Phase Type CTL USB control transfer IN Data in transfer OUT Data out transfer USTS USB status 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) ------ ----- -------------------------------------------------- ---------------- ------------------ 16.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 1.1.0 16.0 IN 12 01 10 01 00 00 00 08 4f 1c 02 00 10 01 01 02 ........O....... 1.2.0 00 01 .. 1.2.16 16.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 2.1.0 16.0 IN 09 02 3b 00 02 01 00 a0 31 ..;.....1 2.2.0 16.0 CTL 80 06 00 02 00 00 3b 00 GET DESCRIPTOR 3.1.0 16.0 IN 09 02 3b 00 02 01 00 a0 31 09 04 00 00 01 03 01 ..;.....1....... 3.2.0 01 00 09 21 10 01 00 01 22 36 00 07 05 81 03 08 ...!...."6...... 3.2.16 00 0a 09 04 01 00 01 03 00 00 00 09 21 10 01 00 ............!... 3.2.32 01 22 32 00 07 05 82 03 03 00 0a ."2........ 3.2.48 16.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 4.1.0 16.0 CTL 80 06 02 03 09 04 04 00 GET DESCRIPTOR 5.1.0(2) 16.0 IN 1a 03 55 00 ..U. 5.2.0 16.0 CTL 80 06 02 03 09 04 1a 00 GET DESCRIPTOR 6.1.0(2) 16.0 IN 1a 03 55 00 53 00 42 00 20 00 4b 00 65 00 79 00 ..U.S.B. .K.e.y. 6.2.0 62 00 6f 00 61 00 72 00 64 00 b.o.a.r.d. 6.2.16 19.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 9.1.0 19.0 IN 12 01 10 01 00 00 00 08 4f 1c 02 00 10 01 01 02 ........O....... 9.2.0 00 01 .. 9.2.16 19.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 10.1.0 19.0 IN 09 02 22 00 01 01 00 a0 31 ..".....1 10.2.0 19.0 CTL 80 06 00 02 00 00 22 00 GET DESCRIPTOR 11.1.0 19.0 IN 09 02 22 00 01 01 00 a0 31 09 04 00 00 01 03 01 ..".....1....... 11.2.0 01 00 09 21 10 01 00 01 22 36 00 07 05 81 03 08 ...!...."6...... 11.2.16 00 0a .. 11.2.32 19.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 12.1.0 19.0 CTL 21 0a 00 00 00 00 00 00 SET IDLE 13.1.0 19.0 CTL 81 06 00 22 00 00 76 00 GET DESCRIPTOR 14.1.0 19.0 IN 05 01 09 06 a1 01 05 08 19 01 29 03 15 00 25 01 ..........)...%. 14.2.0 75 01 95 03 91 02 95 05 91 01 05 07 19 e0 29 e7 u.............). 14.2.16 95 08 81 02 75 08 95 01 81 01 19 00 29 91 26 ff ....u.......).&. 14.2.32 00 95 06 81 00 c0 ...... 14.2.48 20.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 15.1.0 20.0 IN 12 01 10 01 00 00 00 08 4f 1c 02 00 10 01 01 02 ........O....... 15.2.0 00 01 .. 15.2.16 20.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 16.1.0 20.0 IN 09 02 22 00 01 01 00 a0 31 ..".....1 16.2.0 20.0 CTL 80 06 00 02 00 00 22 00 GET DESCRIPTOR 17.1.0 20.0 IN 09 02 22 00 01 01 00 a0 31 09 04 01 00 01 03 00 ..".....1....... 17.2.0 00 00 09 21 10 01 00 01 22 32 00 07 05 82 03 03 ...!...."2...... 17.2.16 00 0a .. 17.2.32 20.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 18.1.0 20.0 CTL 21 0a 00 00 01 00 00 00 SET IDLE 19.1.0 20.0 USTS c0000004 stall pid 19.2.0 20.0 CTL 81 06 00 22 01 00 72 00 GET DESCRIPTOR 20.1.0 20.0 IN 05 0c 09 01 a1 01 85 01 19 00 2a 3c 02 15 00 26 ..........*<...& 20.2.0 3c 02 95 01 75 10 81 00 c0 05 01 09 80 a1 01 85 <...u........... 20.2.16 02 19 81 29 83 25 01 75 01 95 03 81 02 95 05 81 ...).%.u........ 20.2.32 01 c0 .. 20.2.48 19.0 CTL 21 09 00 02 00 00 01 00 SET REPORT 21.1.0 19.0 OUT 01 . 21.2.0 19.1 IN 00 00 00 00 00 00 00 00 ........ 22.1.0

上面的內(nèi)容是電腦對USB鍵盤的枚舉過程。

請問用CH375操作鍵盤時是否也需要進(jìn)行同樣的枚舉?

上面的16、19、20是不是表示鍵盤有三個接口?最終通信用的是19號接口?


上面顯示的枚舉數(shù)據(jù)是一個復(fù)合設(shè)備16有兩個接口19和20,最終通訊是在19接口上。 實際CH375操作的話只需要枚舉一個復(fù)合設(shè)備(設(shè)備描述符、配置描述符),然后分別枚舉19和20的HID類描述符。


CH375芯片在連接鍵盤后,CS#引腳就一直低電平,SETB CS后也一直低電平。加4.7K的上拉電阻也是低電平。這樣正常嗎?


CS#是輸入引腳,電平是由你的單片機(jī)控制的。它內(nèi)部有上拉電阻,不需要再加上拉電阻。


現(xiàn)在出現(xiàn)了無法控制的情況,程序中設(shè)置單片機(jī)控制CS#引腳的輸出為1時,在接上鍵盤后測量電壓為0. 如果拔掉鍵盤,則正常。


檢查一下你的硬件連接,CS與你的單片機(jī)連接,怎么可能受鍵盤控制呢?你的程序上是不是在插入鍵盤或者拔出鍵盤CS#做了不同的操作?


只有登錄才能回復(fù),可以選擇微信賬號登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频