I have my a config file to setup my SDRAM that can be see here: http://pastebin.com/YupajrwX
I have made a test-function to see if I can write and read data to SDRAM which can be seen here: http://pastebin.com/n1UMgbid
If I set Value = 0xAB00 0000 i get:
"Error at counter = 1"
"Error at address 0x2800 0000"
"Data at address 0x2800 0000 is: 0xABAB ABAB"
If i select Value = 0xBB00 0000 i get:
"Data at address 0x2800 0000 is: 0xBBBB BBBB
Howcome this "mirroring effect" takes place? Where am I failing and how can I fix this?
Hello,
In general this topic is covered in various software implementations for the LPC1800/4300, also some app notes are available (mostly valid for LPC1800/4300 as well):
http://www.nxp.com/documents/application_note/AN11508.pdf
http://cache.nxp.com/documents/application_note/AN10935.pdf?fsrch=1&sr=1&pageNum=1
For the software side I recommend to have a look into the following packages and into the attachment (relevant files only):
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hey Sol,
I used the EMC config and I can somewhat read/write from SDRAM.
I have made a test routine that writes from address 0x28000000. Data being written is 0x28000000+i.
When running this routine it stops at different itterations. Is this due to bad timing?
When setting the timing parameters I can't find following in my datasheet for the 64MB SDRAM (AS4C2M32SA-6TIN):
1)
uint32_t ReadConfig; | /*!< Clock*/ |
2)
int32_t tSREX; | /*!< Self Refresh Exit Time */ |
3)
int32_t tAPR; | /*!< Last Data Out to Active Time */ |
If it is not timing based problems, what else could it be?
Kind regardsSigurd