feitian916 发表于 2013-1-22 16:21:22

各位大侠,问下HY27US08561A,我读取ID是正确的,但读数据出错

如题,读数据是,数据全为0,下面是部分代码!请帮帮忙啊,谢谢!@!!
void WrNFCmd(UINT8 CMD)
{
        Port_DataOut;
        flash_ALEL;
        flash_CLEH;
        flash_DataOut = CMD;
        flash_WEL;
        NOP();
        flash_WEH;
        flash_CLEL;
}
UINT8 RdNFDat(void)
{
        UINT8 temp;
        Port_DataIn;
        flash_CLEL; //命令锁存禁止
        flash_ALEL; //地址锁存禁止
        flash_REL;                //读信号使能
        while((flash_RB) == 0);
        NOP();
        temp = flash_DataIn;
        flash_REH;
        return temp;
}
void WrNFAddr(UINT8 add)
{
        Port_DataOut;
        flash_WEH;
        flash_CLEL;
        flash_ALEH;
        flash_DataOut = add;
        flash_WEL;
        NOP();
        flash_WEH;
        flash_ALEL;
}
//读数据,只读a区域
void flash_ReadPage(UINT16 page)
{
        UINT8 i;
        UINT32 temp = 0;
        flash_CEL;
        //写命令
        WrNFCmd(0);////write the first half page
        //写地址
        WrNFAddr(0);
        WrNFAddr(page&0x00ff);
        WrNFAddr(page>>8);
        //等待芯片Ready
        WaitNFBusy();
        //读数据
        for(i = 0;i<256;i++)
                Readbuf = RdNFDat();
        flash_CEH;
        WaitNFBusy();
}
页: [1]
查看完整版本: 各位大侠,问下HY27US08561A,我读取ID是正确的,但读数据出错