[tr]您好:
请问一下,我以下是想实现读flash的ID,在0x555写入0xAA,在0x2AA写入0x55,在0x555写入0x90,
然后再在0x01出取得DEVICE ID ,我调试了很久,多读不到数据?1、不知道这样子写是不是有问题 ?
2、配置为管脚复用之后,还需要配置EMA_nCS,EMA_nWE,EMA_nOE为GPIO口吗?
short emif_rbuffer[10];
short emif_wbuffer[10]={0xAA,0x55,0x90,0,0,0,0,0,0,0};
((short *)(SOC_EMIFA_CS2_ADDR+0x555))[0]=emif_wbuffer[0];
((short *)(SOC_EMIFA_CS2_ADDR+0x2AA))[0]=emif_wbuffer[1];
((short *)(SOC_EMIFA_CS2_ADDR+0x555))[0]=emif_wbuffer[2];
emif_wbuffer[3]=((short *)(SOC_EMIFA_CS2_ADDR+0x01))[0];
这个是EMIFA接口的初始化:
void EMIFA_SetUp(void)
{
EMIFAPinMuxSetup();
//选为normal模式
EMIFAAsyncDevOpModeSelect(SOC_EMIFA_0_REGS,EMIFA_CHIP_SELECT_2,EMIFA_ASYNC_INTERFACE_NORMAL_MODE);
//禁止WAIT引脚
EMIFAExtendedWaitConfig(SOC_EMIFA_0_REGS,EMIFA_CHIP_SELECT_2,EMIFA_EXTENDED_WAIT_DISABLE);
//配置 w_setup,w_strobe,w_hold
EMIFAWait
timingConfig(SOC_EMIFA_0_REGS,EMIFA_CHIP_SELECT_2,EMIFA_ASYNC_WAITTIME_CONFIG(3,2,3,3,3,2,0));
//配置数据总线16bit
EMIFAAsyncDevDataBusWidthSelect(SOC_EMIFA_0_REGS,EMIFA_CHIP_SELECT_2,EMIFA_DATA_BUSWITTH_16BIT);
}
[/tr]