Hello,
I'm trying to use the EMC to control two 64Mbit SRAM modules (AS6C6416).
I don't see any example code for SRAM, only SDRAM. Is there a sample project using SRAM that I can reference?
My SRAM init routine:
[code]
void initStaticRam()
{
emc_basic_config_t basicConfig;
emc_static_chip_config_t staticConfig[2];
basicConfig.endian = kEMC_LittleEndian;
basicConfig.fbClksrc=kEMC_IntloopbackEmcclk;
basicConfig.emcClkDiv = 1;
staticConfig[0].chipIndex = 0;
staticConfig[0].memWidth = kEMC_16BitWidth;
staticConfig[0].specailConfig = 0;
staticConfig[0].tWaitWriteEn_Ns = 10;
staticConfig[0].tWaitOutEn_Ns = 10;
staticConfig[0].tWaitReadNoPage_Ns = 10;
staticConfig[0].tWaitReadPage_Ns = 10;
staticConfig[0].tWaitWrite_Ns = 10;
staticConfig[0].tWaitTurn_Ns = 10;
staticConfig[1].chipIndex = 1;
staticConfig[1].memWidth = kEMC_16BitWidth;
staticConfig[1].specailConfig = 0;
staticConfig[1].tWaitWriteEn_Ns = 10;
staticConfig[1].tWaitOutEn_Ns = 10;
staticConfig[1].tWaitReadNoPage_Ns = 10;
staticConfig[1].tWaitReadPage_Ns = 10;
staticConfig[1].tWaitWrite_Ns = 10;
staticConfig[1].tWaitTurn_Ns = 10;
EMC_Init(EMC, &basicConfig);
EMC_StaticMemInit(EMC, 0, staticConfig, 2);
}
[/code]
Thanks!
Hi, Lon,
I think that your code to initialize EMC is correct, furthermore, you have to set up the EMC pin assignment.
Regarding the wait parameters, I suppose that the
.tWaitWrite_Ns parameter should be greater than the .tWaitWriteEn_Ns, pls check yourself.
I suppose that the
.tWaitReadNoPage_Ns parameter should be greater than the .tWaitOutEn_Ns, pls check yourself.
For detailed inf, pls refer to the section 11.5 External memory interface in data sheet of LPC546xx.
Hope it can help you
BR
XiangJun Rong
Hi,
I copy the part from data sheet.
BR
XiangJun Rong