Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

Nios II SPI Communication

TFern4
Novice
2,240 Views

Hi, I'm working on a project where I have to use the SPI Communication to interface the DE10 nano board (master) with an ADC (slave)  to convert the anolog signal to a binary value. I checked and I saw that there is a SPI (3 wire serial) core built in Qsys, but I have no idea how to use it. I read in some documentations about the SPI core but I didn't understand very well. If anyone has any examples or can help me I appreciate it.

0 Kudos
4 Replies
Ahmed_H_Intel1
Employee
559 Views

Hi,

You can find very good references about how to use SPI communication, here is a good example of how to use SPI slave to AVALON memory mapped.

https://www.intel.com/content/www/us/en/programmable/support/support-resources/design-examples/intel...

Attached is a project I've created to read an ADC value via SPI using the ADC Controller for DE-series Boards IP Core.

 

TFern4
Novice
559 Views

I made a similar project using the internal ADC too, but now I need to interface the FPGA with an external ADC because I have to read two channels simultaneously. Do you know if the commands to write/read with an external ADC are the same? Like IOWR() and IORD(). Thanks.

Abe
Valued Contributor II
559 Views

You can create a basic NIOS2 - SPI system like the one shown and then export the SPI interface externally and connect it to the ADC board.

 

NIOS_SPI_ADC.jpg

TFern4
Novice
559 Views

Do you know what is the commands to write/read using the SPI (3 Wire Serial) Core? Would be IOWR(SPI_BASE, ... ) and IORD(SPI_BASE, ... )? Thanks.

Reply