LPC2478 how to initialize a SDRAM

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

LPC2478 how to initialize a SDRAM

跳至解决方案
1,603 次查看
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 项奖励
回复
1 解答
1,326 次查看
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 项奖励
回复
1 回复
1,327 次查看
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 项奖励
回复