使用S12X的EBI,读数据正常,写数据写不进去,不知道为什么原因,请高手指教 程序如下: #define EXT_SEG00 (*((INT8U *)0x008000)) void main(void) { DisableInterrupts; CRG_init(); //系统时钟初始化40M SCIInit(9600); //串口初始化,波特率为9600 EBICTL0=0x06; //0b00010110 // |||||| //扩展模式设置 // || | - // ||-------10110:ASIZ[4:0]:ADDR[21-1] // |---------0,DATA[15:8] UDS and LDS disabled ,只用到低8位 //2.Enable appropriate chip select signal (CS3E:CS0E)through the MMCCTRLO register //MMC control register MMCCTL0 = 0x08; //Enable CS3 chip select 0x00_0800-0x0F_FFFF
//3.Select the desired number of stretch cycles (6 read m,2Write) and disable //the external wait feature through the EBICTRL1 register
//4.Set MCU into normal expanded mode through the MODE Register MODE=0xA0;//Normal expanded mode,MODC = 1, MODB = 0, MODA = 1 (Normal Expanded Mode)
EXT_SEG00=0xAA; //写入数据 delayms(1000); //写入后延时
// SCISend1(temp); // 读出数据为0xFF; SCISend1(EXT_SEG00);
SCISend1((INT8U)(*((INT8U *)0x008001))); SCISend1((INT8U)(*((INT8U *)0x008002)));
} 读出来数据仍是没有写入数据之前的数据FF FF FF 为什么数据写不进去呢? |