Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)

SPI interface in Qsys

Altera_Forum
Honored Contributor II
2,110 Views

Hello, 

 

I want to learn if putting SPI core is the only thing we should do to interface two components with SPI and also if possible can someone help me with the connections. I plan that one side of the interface will be NIOS II processor. I would be thankful for any help I can get. 

 

Thanks
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
1,238 Views

Hi, 

 

Add SPI core to Qsys. 

Connect SPI interface - MISO, MOSI, SCLK, and SS_n - to your FPGA I/Os 

Connect SPI control port (MM Slave) to Nios. 

Connect clock and reset to Nios. 

 

Attached are a couple of screenshots. 

 

Hope that helps, 

Evgeni
0 Kudos
Altera_Forum
Honored Contributor II
1,238 Views

Hi,  

 

First of all thank you for answering but I have some questions again from NIOS I would like yo send data and see it in the spi output. For that I understand I should be placing those and do the necessary connections. Then how can I send data from NIOS? I2ve never used NIOS before but I would like to send data and using Signal Tap I would like to observe the sent data in the spi output. But I really do not know how to use NIOS so that I can send data. Could you help? 

 

Thanks 

Best wishes
0 Kudos
Altera_Forum
Honored Contributor II
1,238 Views

Hi, 

 

You might want to get started by reading SPI core documentation in Altera's ug_embedded_ip.pdf (www.altera.com/literature/ug/ug_embedded_ip.pdf) document on page 85.  

Then you can also take a look at how the SW driver is implemented. It's in Altera installation directory, just search for "altera_avalon_spi.c". All the includes are in the same directory. 

 

Thanks, 

Evgeni
0 Kudos
Altera_Forum
Honored Contributor II
1,238 Views

Hi, 

 

Thanks again. I have read those actually but I am not sure what to do. In the C code there is a function and is all I should do is a call to that function? In SPI core documentation in Altera's ug_embedded_ip.pdf document it sounds like everything is automatic you just do some connections but I guess that is not the case. How can I sent something from NIOS to SPI core so it is transmitted with SPI. What does the code look like? 

 

Thanks, 

Ugur
0 Kudos
Reply