LP546XX EMC SRAM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LP546XX EMC SRAM

576 Views
LPChicago
Contributor I

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!

Labels (1)
0 Kudos
Reply
2 Replies

559 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

 

 

0 Kudos
Reply

558 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I copy the part from data sheet.

BR

XiangJun Rong

 

xiangjun_rong_0-1612159508815.png

 

0 Kudos
Reply