Altera_Forum
Honored Contributor
13 years agoSPI master with DMA controller
Hi everybody! I need to implement an spi link beetwen a cyclone4 (master) and a spartan3a (slave) fpga. I would like to implement a DMA base solution where the master reads continuously data from slave and save this data in ram. Actually I have a working solution without DMA but I want to free NIOSII from this task. My idea is NIOSII operates on other tasks and everytime it needs of data from spartan3a it can read ram location where DMA engine write. I think this is possible and maybe quite easy but I don't be able to find enough information to do it by myself...if someone could help me...
I use a DBC4CE55 board, this code read continuously 32 bit from spi slave and show on leds a part of these 32 bit received data. int main() { alt_u32 *response_packet=0; while(1) { alt_avalon_spi_command(SPI_BASE, 0, 0, NULL, 1, response_packet , 0); IOWR_ALTERA_AVALON_PIO_DATA(LED_BASE, *response_packet>>3); } return 0; } Now I have added a DMA controller in my qsys design and connect it to spi core...for the software side I have many doubts...is there any examples? Thanks