Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21608 Discussions

SPI using DMA-Controller

Altera_Forum
Honored Contributor II
1,363 Views

Hello, 

 

this is my first thread here and I am a newbie. So I hope my questions aren't too stupid. :D  

 

Currently I am trying to create a SPI Connection between 2 FPGAs. This Connection should work independently from the CPUs of the FPGAs.  

The CPU of the first FPGA shall write data to RAM and post a send request to the DMA-Controller. After that, the DMA-Controller shall transmit the data to the second FPGA using a SPI-Connection. The CPU of both FPGAs should be able to process other tasks at the same time. 

 

[CPU]--[RAM]--[DMA-Ctrl]--[SPI-Master] - - - - - - - [SPI-Slave]--[DMA-Ctrl]--[RAM]--[CPU] 

 

The first thing I need to know is, if it is possible to create this system. 

 

The second questions is, if I can use a standard DMA-Controller or if I have to develop a customized DMA-Controller, which knows how to handle SPI. 

 

I would be glad, if someone could help me. 

 

Thanks in advance 

drak0r
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
651 Views

Hello, 

 

I'd be suprised if you find a DMA controller with SPI. 

 

You could use an existing DMA controller and add an SPI interface onto it. So your processor writes thh data to memory and the DMA controller then reads it out and "SPIerizes" it
0 Kudos
Altera_Forum
Honored Contributor II
651 Views

First of all: Sure, it is possible to create this system. The devil may be in the details. If you transmit a data paket from the master to the slave then the master CPU will know about the amount of data. The slave DMA controller might not. Somebody must tell the slave DMA controller how many data bytes will be sent and the DMA controller should have means to interrupt the slave CPU when this amount has been received. Having said this I guess that it might be best if you write your own DMA controllers. 

 

Harald
0 Kudos
Reply