Content originally posted in LPCWare by Qazzaq on Thu Apr 12 11:49:32 MST 2012
Hi everyone, Please, help me solve problem with EMC on LPC1788.
I configure EMC static memory (using LPC1788 188pins, no dynamic memory) and when I read from it everything is fine, but when I write to it there's no WE.
All pins configured rightly, debug shows that everything is normal, CS, data bus and address bus responds correctly, but WE is always high.
My code for EMC is below. Maybe someone has the same problem?
LPC_SC->PCONP |= (1 << 11); //11 PCEMC External Memory Controller power/clock control bit.
/* P3.0-P3.7 - EMC_D[0-7]
* P4.0-P4.15 - EMC_A[0-15]
*
* P4.24 - /EMC_OE
* P4.25 - /EMC_WE
*
* P4.30 - /EMC_CS0
* P4.31 - /EMC_CS1
*/
for(i = 0; i < 16; i++)
{
if (i < 8) PINSEL_ConfigPin(3,i,1);
PINSEL_ConfigPin(4,i,1);
}
PINSEL_ConfigPin(4,24,1); //OE
PINSEL_ConfigPin(4,25,1); //WE
PINSEL_ConfigPin(4,30,1); //CS0
PINSEL_ConfigPin(4,31,1); //CS1
LPC_EMC->Control = 0x00000001;
LPC_EMC->Config = 0x00000000;
/* Config CS1 and CS0 :
Memory width 8 bit, Page mode disabled
Extended wait disabled, Writes not protected
*/
LPC_EMC->StaticConfig0 = 0;
LPC_EMC->StaticConfig1 = 0;