Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
15322 Discussions

Using IOWR/IOWR_32DIRECT macro to transfer char array to SDRAM

Altera_Forum
Honored Contributor II
1,002 Views

Hello, 

 

I'm new to both C and using NIOS and I can't seem to figure out how to use the IOWR_32DIRECT macro. I'm trying to transfer a 2D unsigned char array (rx_frame) from on-chip memory to the SDRAM, 32 bits at a time. The data bus is 32 bits on both the on-chip memory and SDRAM controller. 

 

Here's what I have: 

 

for (i = 0; i < length; i++) { 

IOWR_32DIRECT(4*i, 0, rx_frame[0][4*i]); 

 

The result is that I get rx_frame[0][0] at location 0x0 but locations 0x1,0x2 and 0x3 are 0. 

Then I get rx_frame[0][4] at location 0x4 but locations 0x5, 0x6 and 0x7 are 0. 

Then I get rx_frame[0][8] at location 0x8 but locations 0x9, 0xA and 0xB are 0. 

Then I get rx_frame[0][12] at location 0xC but locations 0xD, 0xE and 0xF are 0. etc... 

 

Any idea what I'm doing wrong and what I should be doing ?
0 Kudos
0 Replies
Reply