Content originally posted in LPCWare by Hiromi on Fri Mar 08 04:34:17 MST 2013
Hello, I'm using a PSRAM to run code and I need to improve the performance.
Microcontroller: lpc1788.
PSRAM: IS66WVE2M16BLL.
Clock: 96MHz
EMC configuration:
LPC_SC->EMCCLKSEL = 0;
LPC_EMC->Control = 0x00000001;enabled...
LPC_EMC->Config = 0x00000000;
EMC_StaMemConfigMW(2,EMC_StaticConfig_MW_16BITS);
EMC_StaMemConfigPB(2,EMC_StaticConfig_PB);
WAITWEN (NS_2_CLKS(24)));
WAITOEN (NS_2_CLKS(0)));
WAITRD (NS_2_CLKS(70)));
WAITPAGE (NS_2_CLKS(20)));
WAITWR (NS_2_CLKS(46)));
WAITTURN(0x01));
delay();
pageMode();
bufferEnable();
QUESTION 1:
I read in the User Manual that EMC can be calibrated using EMCCAL.
With this code I obtain the calibration value:
LPC_SC->EMCCAL |= EMC_CAL_START;
while(!(LPC_SC->EMCCAL & EMC_CAL_DONE));
uint32_t calibrationValue = EMC_CAL_CALVALUE(LPC_SC->EMCCAL);
But I don't know how to use this value.
In the UM it is suggested to "Adjust one or more programmable delays if needed based on the calibration result."
How should I use the calibration value to adjust the EMC delays?
QUESTION 2:
How should I configure the following:
LPC_SC->EMCDLYCTL =
EMC_DLYCTL_CMDDLY(x)| // x * 250ps
EMC_DLYCTL_FBCLKDLY(y)|
EMC_DLYCTL_CLKOUT0DLY(z)|
EMC_DLYCTL_CLKOUT1DLY(k);?
Thank You in advance...