单片机使用了STC12C5A60S2,采取查询中断的方式,程序写好之后现在可以正常读取鼠标的数据,但是我希望375读取一个USB触摸屏的信号时却出了问题。程序一开始的set_usb_mode、set_freq和reset_device都正常,但是在get_descr的时候一直不产生中断,然后程序就一直卡在while ( CH375_INT_WIRE );这个地方不动了,用逻辑分析仪发现确实没产生中断电平...但只要一换回鼠标马上就正常了...换了功率更大的电源也一样没有变化...改成get_descr_ex之后鼠标依然能正常读,但是触摸屏还是没反应... BUS Hound抓到的触摸屏数据如下:
Device Phase Data Description Cmd.Phase.Ofs(rep) ------ ----- ------------------------ ---------------- ------------------ 41.0 CTL 80 06 00 01 00 00 12 00 GET DESCRIPTOR 1.1.0 41.0 IN 12 01 10 01 00 00 00 40 .......@ 1.2.0 ef 0e 02 73 97 09 01 02 ...s.... 1.2.8 00 01 .. 1.2.16 41.0 CTL 80 06 00 02 00 00 09 00 GET DESCRIPTOR 2.1.0 41.0 IN 09 02 22 00 01 01 01 a0 .."..... 2.2.0 32 2 2.2.8 41.0 CTL 80 06 00 02 00 00 22 00 GET DESCRIPTOR 3.1.0 41.0 IN 09 02 22 00 01 01 01 a0 .."..... 3.2.0 32 09 04 00 00 01 03 01 2....... 3.2.8 02 00 09 21 10 02 00 01 ...!.... 3.2.16 22 42 01 07 05 81 03 40 "B.....@ 3.2.24 00 01 .. 3.2.32 41.0 CTL 00 09 01 00 00 00 00 00 SET CONFIG 4.1.0 41.0 CTL 21 0a 00 00 00 00 00 00 SET IDLE 5.1.0 41.0 USTS c0000004 stall pid 5.2.0 41.0 CTL 81 06 00 22 00 00 82 01 GET DESCRIPTOR 6.1.0 41.0 IN 05 0d 09 04 a1 01 85 04 ........ 6.2.0 09 22 a1 00 09 42 15 00 ."...B.. 6.2.8 25 01 75 01 95 01 81 02 %.u..... 6.2.16 09 32 15 00 25 01 81 02 .2..%... 6.2.24 09 51 75 05 95 01 16 00 .Qu..... 6.2.32 00 26 10 00 81 02 09 47 .&.....G 6.2.40 75 01 95 01 15 00 25 01 u.....%. 6.2.48 81 02 05 01 09 30 75 10 .....0u. 6.2.56 95 01 55 0d 65 33 35 00 ..U.e35. 6.2.64 46 72 22 26 ff 7f 81 02 Fr"&.... 6.2.72 09 31 75 10 95 01 55 0d .1u...U. 6.2.80 65 33 35 00 46 87 13 26 e35.F..& 6.2.88 ff 7f 81 02 05 0d 09 55 .......U 6.2.96 25 08 75 08 95 01 b1 02 %.u..... 6.2.104 c0 c0 05 01 09 01 a1 01 ........ 6.2.112 85 01 09 01 a1 00 05 09 ........ 6.2.120 19 01 29 02 15 00 25 01 ..)...%. 6.2.128 95 02 75 01 81 02 95 01 ..u..... 6.2.136 75 06 81 01 05 01 09 30 u......0 6.2.144 09 31 16 00 00 26 ff 0f .1...&.. 6.2.152 36 00 00 46 ff 0f 66 00 6..F..f. 6.2.160 00 75 10 95 02 81 02 c0 .u...... 6.2.168 c0 06 00 ff 09 01 a1 01 ........ 6.2.176 09 01 15 00 26 ff 00 85 ....&... 6.2.184 03 75 08 95 3f 81 02 06 .u..?... 6.2.192 00 ff 09 01 15 00 26 ff ......&. 6.2.200 00 75 08 95 3f 91 02 c0 .u..?... 6.2.208 05 0d 09 04 a1 01 85 02 ........ 6.2.216 09 20 a1 00 09 42 09 32 . ...B.2 6.2.224 15 00 25 01 95 02 75 01 ..%...u. 6.2.232 81 02 95 06 75 01 81 03 ....u... 6.2.240 05 01 09 30 75 10 95 01 ...0u... 6.2.248 a4 55 0d 65 33 36 00 00 .U.e36.. 6.2.256 46 72 22 16 00 00 26 ff Fr"...&. 6.2.264 0f 81 02 09 31 16 00 00 ....1... 6.2.272 26 ff 0f 36 00 00 46 87 &..6..F. 6.2.280 13 81 02 b4 c0 c0 05 0d ........ 6.2.288 09 0e a1 01 85 05 09 22 ......." 6.2.296 a1 00 09 52 09 53 15 00 ...R.S.. 6.2.304 25 0a 75 08 95 02 b1 02 %.u..... 6.2.312 c0 c0 .. 6.2.320 41.0 CTL 80 06 02 03 09 04 02 02 GET DESCRIPTOR 7.1.0 41.0 IN 28 03 55 00 53 00 42 00 (.U.S.B. 7.2.0 20 00 54 00 6f 00 75 00 .T.o.u. 7.2.8 63 00 68 00 43 00 6f 00 c.h.C.o. 7.2.16 6e 00 74 00 72 00 6f 00 n.t.r.o. 7.2.24 6c 00 6c 00 65 00 72 00 l.l.e.r. 7.2.32 41.0 CTL a1 01 04 03 00 00 02 00 GET REPORT 8.1.0 41.0 IN 04 04 .. 8.2.0 41.0 CTL 80 06 02 03 09 04 02 02 GET DESCRIPTOR 9.1.0 41.0 IN 28 03 55 00 53 00 42 00 (.U.S.B. 9.2.0 20 00 54 00 6f 00 75 00 .T.o.u. 9.2.8 63 00 68 00 43 00 6f 00 c.h.C.o. 9.2.16 6e 00 74 00 72 00 6f 00 n.t.r.o. 9.2.24 6c 00 6c 00 65 00 72 00 l.l.e.r. 9.2.32 41.0 CTL 21 09 05 03 00 00 03 00 SET REPORT 10.1.0 41.0 OUT 05 02 00 ... 10.2.0 看起来和鼠标也没有太大区别...请问究竟会是什么问题呢?求高手解答...[Emot]19[/Emot]