Forum Discussion
4 Replies
- Altera_Forum
Honored Contributor
you can try to make a pointer that points to the start address you want to write to (somewhere in the address span of the SDRAM).
Then issue memcpy with source and destination pointers. See documentation of memcpy. Or, you can do a loop manually : short* psrc = xxxx //location of the source data short* pdst= yyyy //some address in the SDRAM address space you need to write to for (int k=0; k < 640*480; k++) *pdst++ = *pscr++ If you don't understand this, please try to get some experience on C/C++ first. Stefaan - Altera_Forum
Honored Contributor
It's unclear, if you want to access the SDRAM from NIOS II C code or VHDL.
- Altera_Forum
Honored Contributor
Indeed Frank, I made the (maybe wrong) assumption that rprag used the NIOS processor to transfer the data.
Stefaan - Altera_Forum
Honored Contributor
Hello,thank you for replying.
I make a project ,using vhdl code.I found an ALTERA code for SDR SDRAM controller, and I try to write into DE2 SDRAM, data from camera of 640*480 resolution, each pixel is 16 bits. My question is in vich order and vich commands to use , in order to write data to SDRAM.I don't know, if I should give the adresses,or they promote automaticly. I'l apreciate if YOU could send me an example of the orders for writung this data length and/or some explanation. Thank YOU, Roman.