硬件:为什么我从rtl8019as的RAM读出一段连续数据都是一样的? 我读写寄存器都是正确的。可我每次从0x40以后的某页开始读去256个字节,每次读出
的数据全部是同样的一个值,而isr告诉已经溢出,curr=0x7f,应该是已经收到数据了。
我的读数据程序如下,大家看看有什么不对?
void DMARead(uchar *indata,uint count,uint addrh,uint addrl)
{
uint i,temp;
uchar h_DMAcnt,l_DMAcnt;
/*compute the high and low remote DMA byte count*/
h_DMAcnt=count/256;
l_DMAcnt=count%256;
port300=0x22;/*start the controller,no DMA operation*/
temp=port300;
port309=addrh;/*RSAR1 dma read highaddress=0 */
port308=addrl;/*RSAR0 dma read lowaddress=0*/
port30b=h_DMAcnt;/*RBCR1 remote DMA count high */
port30a=l_DMAcnt;/*RBCR0 count low */
port300=0x0a;/*dma read and start*/
temp=port300;
/*00001010*****************************/
/*00*******************page 0**********/
/***001****************Remote DMA Read*/
/******0***************NO Transmit*****/
/*******10*************Start command***/
for(i=0;i<count;i++){
temp=port310;
*(indata+i)=temp;
}
port30b=0;
port30a=0;
port300=0x22;
}