我的硬件是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...