Altera_Forum
Honored Contributor
14 years agoaccess to every address of SDRAM
I have a problem with reading and writing data on SDRAM, I need to access every address of SDRAM, this is my C code written for Nios:
# include <stdio.h> # include <io.h> # define BASE_SDRAM 0x00800000 # define basic_Addr (int *) 0x00800000 void main(){ int Val; Val=IORD(BASE_SDRAM, 6000); // Method 1 printf("%d",Val); Val=*(basic_Addr+6000); // method 2 printf("%d",Val) } for both methods answer is same but it is wrong, when I compare answer with what I get using controlpanel !!!, just for address 0 the answer is correct, I tried this also for FLash, but same problem, can't get proper answer. my sdram clk follow cpu clk with 3ns delay(using SDRAM Altera tutorial). frequency is 50MHz and also tried with 100Mhz. please help me on this .