我在用CH365對(duì)雙口RAM進(jìn)行讀寫(xiě)時(shí),每次讀取的數(shù)據(jù)量為3K.讀寫(xiě)速度設(shè)為0x12.開(kāi)始讀幾次可能是對(duì)的.但多讀幾次就會(huì)不對(duì).讀回的數(shù)據(jù)全為FF.而且無(wú)法再修改.我讀了配置空間04單元的數(shù)據(jù)為03H.沒(méi)有變?yōu)?0H.有時(shí),只是讀取數(shù)據(jù)不對(duì)FFH.有時(shí)就是系統(tǒng)無(wú)法工作.CPU的利用率為100%.要重新開(kāi)機(jī)才行.重新開(kāi)始又是對(duì)的.可以進(jìn)行讀寫(xiě).但讀幾次又不對(duì)了. 這是我的讀寫(xiě)程序. mPCH365_IO_REG mBaseAddr; mPCH365_MEM_REG mMemAddr;
void ReadDataFromSRam(UINT mAddr,short int * TempIntPoint,UINT DataLength) { UINT mIndex; UINT i; UCHAR cByte; UCHAR TempCharPoint[3168]; ULONG D_Length; D_Length=DataLength;//3168 mIndex=0; if ( CH365mAccessBlock( mIndex,mFuncReadMemDword,&mMemAddr->mCh365MemPort[mAddr],TempCharPoint,D_Length ) == FALSE ) { AfxMessageBox(" 塊讀寫(xiě)錯(cuò)誤 "); } } PCB方面我也是按照EVTPCB的說(shuō)明來(lái)做的. 請(qǐng)指點(diǎn)!