Content originally posted in LPCWare by wlamers on Fri Jun 21 02:13:05 MST 2013Thanks for your information.
Unfortunately changing the EMCDELAYCLK (tried 0x0000 till 0x5555), or the clock frequency (tried 12 to 96 MHz) does not work. The latencies (3-3) are correct. Maybe I am doing something wrong in the other timings? These are the values @ 96 MHz:
LPC_SCU->EMCDELAYCLK = 0x00000000;
LPC_EMC->DYNAMICCONFIG2 = (0 << 14) | (13 << 7); // 256Mbit(16Mb x 4 x 4 banks) in ROW BANK COLUMN mode (RBC), row len = 13, column len = 9 DYNAMICCONFIG2-> bit[14] = 0, bit[12:7] = 001101
LPC_EMC->DYNAMICRASCAS2 = 0x00000303; // Latency: RAS 3, CAS 3 CCLK cyc.
LPC_EMC->DYNAMICRP = 1;
LPC_EMC->DYNAMICRAS = 3;
LPC_EMC->DYNAMICSREX = 6;
LPC_EMC->DYNAMICAPR = 0;
LPC_EMC->DYNAMICDAL = 5;
LPC_EMC->DYNAMICWR = 1;
LPC_EMC->DYNAMICRC = 5;
LPC_EMC->DYNAMICRFC = 5;
LPC_EMC->DYNAMICXSR = 6;
LPC_EMC->DYNAMICRRD = 0;
LPC_EMC->DYNAMICMRD = 0;
LPC_EMC->DYNAMICREFRESH = 110; // 110x16 EMC_CCLK's between refresh cycles.
And this is the burst length:
uint32_t DynBaseAddr = SDRAM_BASE_ADDR;
uint32_t ModeRegister = 0x23; // burst length 8, sequential mode, latency 2, standard operation mode, programmed burst length mode
uint8_t Offset = 12; // 9 columns + 1 bus width + 2 bank select bits = 12
*((volatile uint32_t *) (DynBaseAddr | (ModeRegister << Offset)));
Any idea?