Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

NIOS read from SRAM

hey all,

i've been trying to read data from the SRAM on a DE2 development board using a program run in the NIOS II IDE. i'm not sure i'm using the proper calls, because i'm not getting the data that is in the SRAM. the data is a full video frame (to be sent to a console via ethernet), which i can view using the USB app...not only does my IORD call return a bogus pattern, but that then overwrites the SRAM (as discovered when the SRAM is later read from the USB app). not sure if all of this is clear...but the following is a portion of my code.

int i = 0;

int o = 0;

int temp = 0;

for (i; i < 60; i++) {

for (o; o < 1440; o+=2) {

temp = IORD(SRAM_0_BASE+(1440*i)+o, 0);

video[o+42] = temp % 0x100;

video[o+43] = (temp % 0x10000) >> 8;

}

TransmitPacket(video,0x5CA);

}

any ideas? is IORD the proper way to do this?