LPC2478 how to initialize a SDRAM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC2478 how to initialize a SDRAM

Jump to solution
1,538 Views
haoch
Contributor I

Hello,i change a SDRAM of 32M to a SDRAM of 4M ,i rewrite the code  as following ,but it still goes wrong, where else should i rewrite? TAHNKS

1.#define SDRAM_SIZE 0x00800000 //8M
//#define SDRAM_SIZE 0x02000000 // 32M

2. /* 64MB, 4Mx16, 4 banks, row=12, column=8 */
EMC_DYN_CFG0 = 0x00000280;
/* 256MB, 16Mx16, 4 banks, row=13, column=9 */

//EMC_DYN_CFG0 = 0x00000680;

3. dummy = *((volatile DWORD *)(SDRAM_BASE_ADDR | (0x33 << 11)));
// dummy = *((volatile DWORD *)(SDRAM_BASE_ADDR | (0x33 << 12))); //32M

0 Kudos
Reply
1 Solution
1,261 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi,

Have you ensured that both memories are physically connected to the same base address? On your rewritten definitions, you have changed SDRAM_SIZE, but SDRAM_BASE_ADDR seems to be the same (just modifying the shift count).

Hope this will be useful for you.

Best regards!

/Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
1 Reply
1,262 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi,

Have you ensured that both memories are physically connected to the same base address? On your rewritten definitions, you have changed SDRAM_SIZE, but SDRAM_BASE_ADDR seems to be the same (just modifying the shift count).

Hope this will be useful for you.

Best regards!

/Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply