Olimex help pls!!! LPC-E2294-1MB REV.B External SRAM access

I have a LPC-E2294-1MB REV.B board with external 1M of fast SRAM.

The test s/w provided in the link from Olimex is totally wrong w.r.to external SRAM access.

The setting for BCFG1 causes DataAbort exception!

After trying different values I am able to write & read back successfully – but the read back values don’t confirm (I seem to read back 0x81818181 at all locations).

Please (anyone) send me working source which has the correct settings for BCFG1 & PINSEL2 registers.

Thanks a lot,

-Mike.

Hello, I have L2294 with 1MB external SRAM. SRAM is connected similary to E2294 board. Two chips are connected as 32-bit memory. Look at my test project and file init.c. May be helpful…

http://nifelheim.homeip.net/nifelheim/s … /Test2294/

Hi Mechanism8,

Thanks for posting a reply, I tried your code but - could not get the UART to work & then I see the following issues:

  1. VPBDIV is set to 0 in init.c but never set to valid value (1, 2, or 4) when calculating UART baudrate XTAL_COEF of 4 is used, which case VPBDIV should be set to 4 (i guess)???

  2. The comments seems to be correct for 10ns SRAM – but the actual value set in BCFG1 dont seem to match.

/*

  • BANK1:

  • MW = 32 bit

  • Trd = 10ns

  • Twr = 10ns

  • Tcyc = 1000000/58982400 = 17ns

  • WST1 >= (Trd + 20ns)/Tcyc - 2

  • WST1 >= (10 + 20) / 17 - 2 = 0

  • WST2 >= (Twr - Tcyc + 5) / Tcyc

  • WST2 >= (10 - 17 + 5) / 17 = 0

*/

#define BANK1_IDCY 4UL

#define BANK1_WST1 1UL

#define BANK1_RBLE 1UL

#define BANK1_WST2 1UL

#define BANK1_MW 2UL

BCFG1 = (BANK1_MW<<28)|(BANK1_WST2<<11)|(BANK1_RBLE<<10)|(BANK1_WST1<<5)|BANK1_IDCY;

For me, the following value for rBCFG1 seem to work without DAbort exception:

#define BANK1_IDCY 0UL

#define BANK1_WST1 0UL

#define BANK1_RBLE 1UL

#define BANK1_WST2 0UL

#define BANK1_MW 2UL //0x20000400;

rBCFG1 = (BANK1_MW<<28)|(BANK1_WST2<<11)|(BANK1_RBLE<<10)|(BANK1_WST1<<5)|BANK1_IDCY;

Also IDCY 1 But 4 casues exception with different values for WST1 & 2

Even though it works, it does always read 0x81818181 regardless of the addreess i read.

values used for rPINSEL2 0x0FE169eC (or) 0x0F804924 – I get the same 0x81818181

Please help me guys!!!

-Mike.

Hello embeddedeng,

According to documentation

“bits 1:0 = 0 0: VPB bus clock is one fourth of the processor clock.”

So setting VPBDIV to 0 means Pclk = Fclk/4

You shouldn’t get data abort regardless of BCFG1 settings, so the problem is probobly elsewhere. Try something simple:

char p = (char)0x81000000;

char ch;

*p = 0x55;

ch = *p;