[求助]CH375B+C8051F020 USB DEVICE數(shù)據(jù)傳輸測試的問題

我的硬件是C8051F020與CH375B,作為USB Device與電腦相連。 用CH372EVT中的測試程序,發(fā)現(xiàn) BulkTest和Speed372測試結(jié)果令人滿意,傳輸率最大可到400K/S左右,也沒有數(shù)據(jù)錯誤。 但是同樣的硬件用Test目錄下的測試程序test.c就不行,其實CH375端口讀寫函數(shù)都是一樣的,其它硬件相關(guān)的設(shè)置都一樣。 后來增加了 讀寫延時(WR,RD寬度),勉強可出數(shù)據(jù),但是從電腦上發(fā)送數(shù)據(jù)后,要等幾秒鐘(3~4秒)才有數(shù)據(jù)傳回來, 而且比較容易出錯。 請問這種現(xiàn)象正常嗎?是什么原因造成的?哪里找問題??? 請高手指點,謝謝! ================== BULK傳輸測試很好 ===================== C:\temp>BULKTEST

CH372/CH375 Bulk Data Test Program V1.1 , Copyright (C) W.ch 2004.12 test data correctness and USB speed *** Load DLL: CH375DLL.DLL *** CH375OpenDevice: 0# *** Step-0: notice MCU start test start test now *** Step-1: test data correctness: 5000 times, random length and data *** passed *** Step-2: test speed of download data: 2048KB data *** download speed = 306586.8 Bytes/Sec, total=2048000 bytes, time=6680 mS *** Step-3: test speed of upload data: 2048KB data *** upload speed = 390318.3 Bytes/Sec, total=2048000 bytes, time=5247 mS *** Total error = 0 *** CH375CloseDevice: 0

Exit.

C:\temp>SPEED372

CH372/CH375 Bulk Data Test Program V1.2 , Copyright (C) W.ch 2004.12 test data correctness and USB speed, use buffer upload mode *** Load DLL: CH375DLL.DLL *** CH375OpenDevice: 0# *** Step-0: notice MCU start test start test now *** Step-1: test data correctness: 1000 times, random length and data *** passed *** Step-2: test speed of download data: 2048KB data *** download speed = 287196.7 Bytes/Sec, total=2048000 bytes, time=7131 mS *** Step-3: test speed of upload data: 2048KB data *** upload speed = 415578.7 Bytes/Sec, total=2051712 bytes, time=4937 mS, 935 *** Total error = 0 *** CH375CloseDevice: 0

Exit.

============= test就很差 ======================= C:\temp>test

CH372/CH375 Bulk Data Test Program V1.1 , Copyright (C) W.ch 2004.12 test data correctness *** Load DLL: CH375DLL.DLL *** CH375OpenDevice: 0# *** Step-1: test data correctness: 10000000 times, random length and data S1-T2-C2 return length error: 0 (40)6CH,D6H,AEH... S1-T2-C6 return length error: 0 (13)EFH,57H,49H... S1-T0-C8 return length error: 0 (64)00H,00H,00H... S1-T2-C10 return length error: 0 (64)3H,E5H,3CH... S1-T0-C12 return length error: 0 (64)0H,00H,00H... S1-T3-C15 return length error: 0 (64)0H,A7H,54H... S1-T1-C17 return length error: 0 (39)FH,FFH,FFH... S1-T3-C19 return length error: 0 (64)FH,7EH,CAH... S1-T1-C21 return length error: 0 (45)FH,FFH,FFH... S1-T0-C24 return length error: 0 (46)0H,00H,00H... S1-T3-C27 return length error: 0 (64)DH,5AH,EAH... Cnt= 29, Len=38, Data: 21H,FFH,FFH,FFH,FFH,FFH...


熱門產(chǎn)品 : USB3.0 HUB控制器:CH634

按照你說的現(xiàn)象的話,估計和你的下位機程序上面有點關(guān)系,你可以拿TEST。C這個程序加上上位機的DEBUG372的程序來進行調(diào)試,你看下可以不可以進行數(shù)據(jù)通信,還有,在上下位機通信的時候,一定要知道彼此的通信協(xié)議才能正常的通信


感謝回復(fù),問題解決了。 問題是CH375_WR_CMD_PORT()函數(shù)漏了2us延時,加上就好了。但是bulk測試就不需要這個延時。


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

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