請教程序問題

printf( "Size=%ld, Len=%d, Sec=%d\n", CH374vFileSize, NewSize, (UINT16)SecCount ); mCmdParam.ReadX.mSectorCount = SecCount; /* 讀取全部數(shù)據(jù),如果超過60個扇區(qū)則只讀取60個扇區(qū) */ mCmdParam.ReadX.mDataBuffer = &my_buffer[0]; /* 指向文件數(shù)據(jù)緩沖區(qū)的起始地址 */ CH374vFileSize += CH374vSectorSize - 1; /* 默認情況下,以扇區(qū)方式讀取數(shù)據(jù)時,無法讀出文件尾部不足1個扇區(qū)的部分,所以必須臨時加大文件長度以讀取尾部零頭 */ i = CH374FileReadX( ); /* 從文件讀取數(shù)據(jù) */ CH374vFileSize -= CH374vSectorSize - 1; /* 恢復(fù)原文件長度 */ mStopIfError( i );

------------------------------------------------------ 我在AVR外擴了32k的sram,其中只是讀U盤文件8M,送到fpga里去。 (1)其中文件大小8M,每次可以讀取30k到sram里,其中my_buffer是必須要用的緩存嗎?不能直接對外擴的sram寫? (2)這樣的結(jié)構(gòu)要送到fpga里是每次先從U盤讀30k到SRAM,然后再從SRAM讀到fpga里去更快? 謝謝了

1,你自己開一個緩沖區(qū),拿mCmdParam.ReadX.mDataBuffer指針去指向你的緩沖區(qū)里面去就可以了。 2,你可以直接從374里面讀取出來直接送到FPGA里面更快


前段時間你說你用的是雙口RAM,這樣的話基本上不浪費時間的,.你可以把my_buffer定義到擴展RAM區(qū).


2,你可以直接從374里面讀取出來直接送到FPGA里面更快 請問這個“直接送”就不需要SRAM了吧,直接用ch374的讀寫信號,能具體說一下控制信號嗎?謝謝


覺得這樣寫進讀出SRAM會浪費時間,直接送進去是個不錯的選擇


不需要過RAM,374的數(shù)據(jù)口與PFGA是直連的,在讀374數(shù)據(jù)期間,即374的RD信號有效期間,使能FPGA的WR信號,這樣數(shù)據(jù)就直接從374的數(shù)據(jù)口進入FPGA。 注意374的RD,WR與FPGA的RD,WR是獨立控制的


我改為了374直連FPGA,讀文件?,F(xiàn)在問題 1.我發(fā)現(xiàn)讀選通時間不是手冊上說的40ns~70ns,而是在500ns左右,我atmeg是8M內(nèi)部的,和時鐘有關(guān)嗎? 2.我看了mybuffer中的數(shù)據(jù)沒錯,但是在讀選通讀數(shù)到fpga的fifo中不正確,可能和問題1有關(guān)。 謝謝先


3.接上,ch374在讀文件之前也應(yīng)該有讀選通信號,這些數(shù)據(jù)是不能寫,應(yīng)該在i=ch374readfile()之后才開始讀數(shù)據(jù)線上的數(shù)據(jù)吧。


讀選通是你的MCU來控制的,和CH374沒有關(guān)系,CH374要求最底要保證40ns~70ns.和時鐘有關(guān)系.給總線設(shè)置也有關(guān)系,你查看相關(guān)資料看看怎么樣才能把速度設(shè)置更快. 不是這樣理解的,CH374隨時在總線上都會有讀選通的.由于我們不知道你系統(tǒng)的具體構(gòu)成,請你下次問問題的時候不要過于簡潔,盡量說詳細點.你說這些數(shù)據(jù)不能寫,是哪些數(shù)據(jù)?


再問一個問題:從atmeg128外擴的SDRM讀數(shù)據(jù),我將*ptr指針賦給內(nèi)部一個uchar變量,為什么rd使能和ale等沒有變化?


這可能是因為MCU自己控制的,因為你訪問的內(nèi)部RAM地址,RD,ALE沒有必要去變化,AVR地址是線性的,沒有內(nèi)部和外部之份,不像51.地址是統(tǒng)一的.


那看來要讀到fpga有點困難了 我在寫到sram里似乎有寫使能,我想在寫sram的時候,也寫進fpga里,不知這個好控制,能實現(xiàn)?


具體什么情況,你可以致電:025-52638375,需要你詳細說明下看下可以不可以給你解決這個問題。


i = CH374FileReadX( ); /* 從文件讀取數(shù)據(jù) */ 我在測試 ptr=(unchar*)0x1100; for(j;j<2048,j++) { *ptr=j; }


i = CH374FileReadX( ); /* 從文件讀取數(shù)據(jù) */ 我在測試 ptr=(unchar*)0x1100; for(j;j<2048,j++) { *ptr=j; } 如果沒有加讀文件數(shù)據(jù)的語句,atmeg128的ale就是正確的,加了之后,就要緊接兩個上升沿才有一個wr選通? 謝謝


你的程序按照上午和你說的,你可以這樣操作: ptr=(unchar*)0x1100; mCmdParam.ReadX.mDataBuffer=ptr; i = CH374FileReadX( ); /* 從文件讀取數(shù)據(jù) */

PUINT8 CH374_READ_BLOCK64( UINT8 mAddr, PUINT8 mBuf ) /* 外部定義的被CH374程序庫調(diào)用的子程序,從雙緩沖區(qū)讀出64字節(jié)的數(shù)據(jù)塊,返回當(dāng)前地址 */ { UINT8 i; UINT8 c; UINT16 New_Size; unsigned char buf[64]; unsigned char *pBuf; Write374Index( mAddr ); if((unsigned short)mBuf != 0x1100){ //操作文件系統(tǒng) *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++;

*mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++;

*mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++;

*mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++;

*mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++;

*mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++;

*mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++;

*mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; *mBuf = CH374_DATA_PORT;mBuf ++; } else { for( i=0;i!=64;i++ ) FPGA_Addr= CH374_DATA_PORT; //循環(huán)64次,直接寫到FPGA里面去

} return( mBuf ); }


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

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