寫CH375B的程序可以用CH375A的子程序庫嗎?
可以使用CH351A的子程序庫,不過建議你把庫升級下,這樣U盤的兼容性會更高
目前CH.75A已經(jīng)停止供貨,建議申請CH375B做實驗。
我們單位原來用CH375A,現(xiàn)在改用CH375B了,我在一款產(chǎn)品上座調(diào)試,加入CH375模塊,不過老出現(xiàn)問題,一調(diào)用CH375DiskReady( );程序就飛了,前面的 CH375Reset( ); Delay(10); i = CH375LibInit( ); /* 初始化CH375程序庫和CH375芯片,操作成功返回0 */ mStopIfError( i ); 和while ( CH375DiskStatus < DISK_CONNECT ) { // 查詢CH375中斷并更新中斷狀態(tài),等待U盤插入 CH375DiskConnect( ); Delay(10); } 都通過了,到那就飛了,不知道跑到哪去了,好像有時會重新從頭開始運行程序
1、更新庫后,程序編譯、鏈接是否正常? 2、LibInit,DiskConnect都成功?
*** WARNING L16: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: CH375FILEREAD/MAIN1 *** WARNING L16: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: CH375FILEWRITE/MAIN1 *** WARNING L16: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: _DELAYNS/LCD12864 *** WARNING L16: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: LCD_BUSY/LCD12864 *** WARNING L16: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: CHARACTER_DISP_TEST1/LCD12864 *** WARNING L16: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: _NUM_DISP/LCD12864 *** WARNING L16: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: CH375FILEMODIFY/CH375MAI *** WARNING L16: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: CH375FILELOCATE/CH375SEC *** WARNING L16: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: CH375BYTEREAD/CH375BYT *** WARNING L16: UNCALLED FUNCTION, IGNORED FOR OVERLAY PROCESS NAME: CH375DISKQUERY/CH375DSZ Program Size: data=24.4 xdata=1189 const=912 code=13492 "U_TEST" - 0 Error(s), 10 Warning(s). 這是編譯的警告,應(yīng)該算正常吧, CH375_PORT_INIT( ); /* 由于使用通用I/O模塊并口讀寫時序,所以進行初始化 */ Delay(10); /* 延時100毫秒 */ CH375Reset( ); Delay(10); i = CH375LibInit( ); /* 初始化CH375程序庫和CH375芯片,操作成功返回0 */ mStopIfError( i ); j = CH375GetVer( ); while ( 1 ) { while ( CH375DiskStatus < DISK_CONNECT ) { CH375DiskConnect( ); // 查詢CH375中斷并更新中斷狀態(tài),等待U盤插入 Delay(10); } Delay(10); /* 延時,可選操作,有的USB存儲器需要幾十毫秒的延時 */ /* 檢查U盤是否準備好,有些U盤不需要這一步,但是某些U盤必須要執(zhí)行這一步才能工作 */ for ( i = 0; i < 5; i ++ ) /* 有的U盤總是返回未準備好,不過可以被忽略 */ { Delay(10); if ( CH375DiskReady( ) == ERR_SUCCESS ) break; /* 查詢磁盤是否準備好 */ } //注:程序調(diào)用到此就飛了。不知道是什么原因,版本號返回30,前邊幾個程序都能通過,就是這個CH375DiskReady( )一調(diào)用就飛 了
單片機的RAM有沒有溢出,用的是什么單片機?RAM,ROM各式多少?