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++
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.
12435 Discussions

Creating a terminal to control Nios-II to send commands to SPI slave

Honored Contributor II

To ease testing of slave devices e.g memory devices, ADCs e.t.c is it possible to create an application where one has a terminal window open on PC from which one can write specific words to an SPI slave connected to the Nios processor and read back out to the screen whatever is read in by the Nios processor?

0 Kudos
3 Replies
Honored Contributor II

Hi, thats possible. 


Which Languages are you using? 


This is a good example code for writing a terminal Program with C#: 


You also need a simple program running on the NIOSII. 

It should parse values from the UART and pass them to the SPI and vice versa. 


For the most devices it should be done easy. 

Maybe for some devices you have to take care about timing. 



Honored Contributor II

Actually I thought that there would be a ready made "terminal window" into Nios-II design accesible from Quartus or Eclipse or some reference design. 


Looking at this it seems this is a custom solution. 


I think there is something about tcl commands that can be used to debug Qsys or SOPC designs, basically we write some tcl command into a command window aka terminal and it transmits something to the design on the FPGA to read/write memory locations. Don't know that details though, I was expecting a response along those lines. 



I mean it does not have to be the humble serial port, I think that this should be possible via the byte-blaster JTAG interface too.
Honored Contributor II

You need to decide if your project is to have an elaborate command line system or to do stuff with I2C. It's fairly simple to write a simple 1 character command parser, but going beyond that becomes a software project.