Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

External memory access

2005-07-01 by lpc_2294

Hello all,

I recently purchased an Olimex LPC - H2294 board with 1MB External
SRAM and 4 MB External Flash.

I have the following problem :

I can't access to the External SRAM memory to write or read into it.

I know that the start addresses of both SRAM are :

Internal SRAM       0x40000000
External SRAM       0x81000000

I know that I have to set the EMC controller but I don't know how.

I would like to know if somebody know how to do this.

I would like to do the same application as below with :

SRAM_BASE     0x81000000    

instead of

SRAM_BASE     0x40000040

I am using the Rowley CrossStudio Evaluation version, I wrote the
following program and it works well in the Internal 16K SRAM of the
LPC2294.

The following code do :

pointer address initialisation

copy integers from 0 to 15 in the internal SRAM

do the sum of these integers and copy this value to the pointer result.

/*

    LPC2294 Internal 16K SRAM Testing

*/

#include <targets/lpc22xx.h>

#define     SRAM_BASE     0x40000040
#define     RESULT        0x400000A0

int *sramIptr = (int *)SRAM_BASE;
int *result   = (int *)RESULT;

int main(void){

  int i;
  int sum = 0;

  sramIptr = (int *)SRAM_BASE;

  for(i = 0; i < 16; i++){
    
    *sramIptr++ = i;

  }

  sramIptr = (int *)SRAM_BASE;

  for(i = 0; i < 16; i++){
    
    sum += *sramIptr++;

  }

  result   = (int *)RESULT;

  *result = (int)sum;

  while(1);

  return 0;
}

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.