Forum Discussion
Altera_Forum
Honored Contributor
21 years agoSDRAM byte (8-bit) write access
Hi all, I've a NiosII system based on EP1C6144, with an extrernal 2Mb 16-bit wide SDRAM. While writing SDRAM with 16 or 32-bit wide data gives the expected result, if I try to wri...
Altera_Forum
Honored Contributor
21 years agoThe one thing which occurs to me is that your code won't work on processors with a cache. You need to use the STBIO instruction instead.
And you should probably use builtin_stbio instead of using inline assembler because the compiler can optimise it much better (or use the HAL macro IOWR_NATIVE8 or something like that which does the same thing). I assume you've checked your objdump file to make sure the compiler hasn't split up your assembler statements (which is will sometimes do to make optimisation better).