lpcware

lpc43xx interface with SDRAM

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by gvandenbosch on Wed Apr 15 02:34:18 MST 2015
Hello.

I have interfaced SDRAM (AS6C8016) with the LPC43xx.
*chip datasheet: http://www.alliancememory.com/pdf/AS6C8016.pdf

To initalize this with the EMC I have used the following code:


#define SDRAM_BASE_ADDR 0x28000000

EMCFlashInit();
vEMC_InitSRDRAM(SDRAM_BASE_ADDR, EMC_SDRAM_WIDTH_16_BITS, EMC_SDRAM_SIZE_16_MBITS, EMC_SDRAM_DATA_BUS_16_BITS, SDRAM_COL_ADDR_BITS);


It executes this function without any problems.

But when I try to use the SDRAM I am getting into trouble, I can not make my buffers larger than 128 bytes.

I am executing the following test where I copy some random data into sdram:

memcpy(vSDRAM,uacTest,128);

unsigned char acRead[200];
memcpy(acRead,vSDRAM,128);


This works fine until 128 bytes, but  with more than 128 bytes it crashes.

However if I add a second buffer of 128 bytes and perform same sort of test like the following it works fine:

memcpy(vSDRAM+128,uacTest,128);
unsigned char acRead2[260];
memcpy(acRead2,vSDRAM+128,128);


I am not very familiar with sdram, is this default behaviour? Or is there going something wrong in my configuration?
My thought were that I could make the buffer as large as I want as long it doesn't exceeds the size of my sdram chip.

Cheers,
Gerard

Outcomes