I encountered a strange problem on my Lpc1788 evaluation board. If i turn off the LCD controller, the SDRAM works fine, it can pass any testing. but if i turn on the LCD controller, SDRAM cannot pass testing. i test the SDRAM by writing (char)0x12 to it and then read it to see if writing and reading is OK. if the LCD controller is on, some of them would become 0xFF. however, if i test the SDRAM with (short)0x1212, the test would pass no matter the LCD controller is on or off. This problem is frustrating.... really hope someone can help me....
What happens if you test with 0x1312?
And what happens if you fill a block with 0x01, 0x02, 0x03, 0x04, ... and then reads back the block?
Note that it isn't uncommon that tests of external memory can give "expected" results even when the memory isn't enabled - the data is written to the processor pins and the pins then manages to retain that state for long enough that a read detects the same pattern. So to test memory, it's important to write varying data to multiple memory addresses and then read back all addresses and check that each of them have the expected content. Only then have you tested that an actual memory stores data and that it isn't the port pin capacitances that stores the last write.
thanks very much for your reply. I followed your advice and did more testing on the SDRAM. Writing and Reading of the SDRAM in char mode did fail in several addresses even with the LCD controller turned off. so it looks like the problem is in the SDRAM. However, testing in short mode and int mode can still pass. what could cause the SDRAM to fail in writing or reading char? this problem is driving me crazy... this is the first time i'm using SDRAM...