Forum Discussion
12 Replies
- Altera_Forum
Honored Contributor
You should get four signals at the top level:
sclk (serial clock) mosi (master out slave in) --> so if you use a SPI master in SOPC Builder this is your serial output miso (master in slave out) --> so if you use a SPI master in SOPC Builder this is your serial input ss/ss_n (slave select) So if the component you are trying to talk to can only do reads for example you don't need to use the mosi signal (your component can't do anything with the data). - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by badomen@Nov 10 2006, 11:47 PM you should get four signals at the top level:sclk (serial clock)
mosi (master out slave in) --> so if you use a spi master in sopc builder this is your serial output
miso (master in slave out) --> so if you use a spi master in sopc builder this is your serial input
ss/ss_n (slave select)
so if the component you are trying to talk to can only do reads for example you don't need to use the mosi signal (your component can't do anything with the data).
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=19370)
--- quote end ---
--- Quote End --- sopc builder shows only 3 pins either for master or slave how can we include the 4th pin as in the spi protocol. thanks in advance.
- Altera_Forum
Honored Contributor
Which three signals? Which signal is missing on the symbol? Be verbose please?
IzI - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by iztok.jeras@Dec 20 2006, 01:41 PM which three signals? which signal is missing on the symbol? be verbose please?izi
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=20135)
--- quote end ---
--- Quote End --- In sopc when i try to configure nios as slave in avlon communication it has spi 3 wire serial ss_n, sclk, miso where is mosi and if we need it in our project how to get this 4th line... thanks in advance...
- Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by ashish+dec 20 2006, 06:54 pm--><div class='quotetop'>quote (ashish @ dec 20 2006, 06:54 pm)</div>--- quote start ---
<!--quotebegin-iztok.jeras@Dec 20 2006, 01:41 PM which three signals? which signal is missing on the symbol? be verbose please?
izi
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=20135)
--- quote end ---
--- Quote End --- In sopc when i try to configure nios as slave in avlon communication it has spi 3 wire serial ss_n, sclk, miso where is mosi and if we need it in our project how to get this 4th line... thanks in advance... <div align='right'><{post_snapback}> (index.php?act=findpost&pid=20141)</div> [/b] --- Quote End --- please also guide me on how to use nios 2 as a spi slave using sopc builder.. i am a newbie in it.. thanks fr ur response in advance.... please response as soon as possible
- Altera_Forum
Honored Contributor
This may be a stupid question, but did you check the right side of the processor symbol created in SOPC builder?
Input signals are located on the left side of the symbol and output signals on the right side. Slave input signals: - sclk - ss_n - mosi Slave output signals: - miso Otherwise, are there any special parameter for SPI slave in SOPC builder? I never implemented a SPI slave, only masters. IzI - Altera_Forum
Honored Contributor
main objective of our project is to test spi master that we have built on MAX 2 cpld with nios acting as slave and also a host for our master.
we are not able to figure out how to use nios 2 as spi slave. can we use spi core available with avalon interface for our purpose. we also need ide code for nios 2 slave. thanks in advance - Altera_Forum
Honored Contributor
It is not very common to have SPI slave connected to a processor and a SPI master on a less intelligent MAX II chip. Usually the roles are inverted.
For instructions on how to use a SPI slave on Nios II, you should stay with the Altera documentation, since this is a rare usage of SPI, probably you will not be able to find someone with experience on the forum. As far as I checked the Altera provided drivers for SPI, they are only for master configurations, where all transfers are initiated by the Nios. IzI - Altera_Forum
Honored Contributor
thanks for reply.. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif
actually we are planning a demo for a spi master and we have nios.. so we want to use it as a slave and as a host... could u suggest some other means for demo.. should we post our problem anywhere else also in the forum if so can u suggest in which link... thanks in advance.. - Altera_Forum
Honored Contributor
SPI flash devices like the EPCS are a good SPI slave for a demo of your SPI master. In your demo you may access a SPI Flash (read its ID, read data, write data). Another good slave for a demo would be a SPI thermometer.
IzI