Altera_Forum
Honored Contributor
11 years agoUsing SPI on Qsys
Hi,
I want to use a DEO NANO FPGA to send a stream of data to an external device (a DDS). I want to use the SPI core Qsys. My address word is 8 bit long and then the data I have to send is 32bits long. The DDS has four pins for this. SDIO (bidirec for data in/out), SDO (out from DDS), sclk (for latching onto the data) and csb (to decide whether data should be latched onto or not). I wanted to use Qsys to use a clock, the nios processor, a memory. JTAG (to connect to computer) and the SPI core. I basically had the Qsys tutorial to refer to where they use Qsys with switches and LEDs. From the tutorial I see that the Qsys generated file is called to the main module.Something as follows: ddstalk NiosII( .clk_clk(CLOCK_50), .reset_reset_n(1'b1), .spi_MISO(sdio), .spi_SCLK(sclk), .spi_MOSI(sdo), .spi_SS_n(q)); What I don't understand is where I can store my data that has to be sent to the DDS from the FPGA. Do I have to change something in the verilog code generated by Qsys or do I just call some other parameter into this module? It would be great if someone had a verilog example of how to use SPI. Or a code for SPI itself and how it is implemented. Thank you very much!