Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
822 Views

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

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
Altera_Forum
Honored Contributor I
41 Views

Hi, thats possible. 

 

Which Languages are you using? 

 

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

http://www.codeproject.com/articles/23656/termie-a-simple-rs-terminal 

 

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. 

 

Greets 

Olaf
Altera_Forum
Honored Contributor I
41 Views

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.
Altera_Forum
Honored Contributor I
41 Views

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.

Reply