Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12589 Discussions

Delay in receiving a byte in SPI slave rxbuffer

Altera_Forum
Honored Contributor II
1,209 Views

Hi, 

I am currently working on a project in which I am interfacing the ANT transceiver (AP2) to the Altera DE2 board through SPI.The ANT transceiver is the master SPI and altera FPGA is the slave SPI.  

 

The problem I am currently facing is that, whenever the ANT (master SPI) transmits a byte to the FPGA (slave SPI) on reset, it does not get received in the rxbuffer of the slave in the ongoing iteration. Although, the byte transferred can be seen on the Logic Analyzer. When the ANT is forced to send another byte by resetting it in the next iteration, this time the byte gets received in the slave rxbuffer. 

 

Can anyone please help me understand why is this happening? Also, what should I be doing to get rid of this delay and be able to read the byte in the slave rxbuffer as soon as the transaction happens?
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
350 Views

Hello, 

Could you post your SPI slave handler? 

May be it'll help us to understand what's happening...
0 Kudos
Altera_Forum
Honored Contributor II
350 Views

Hello, 

 

Thanks for the reply!  

 

Actually I solved the issue. I figured out that in the slave SPI of NiosII, the slave select line always has to go high in order to store a byte in the rxbuffer. Initially I had grounded it so that the slave SPI is always selected . But in that configuration the slave SPI didn't reset itself and ignored the MOSI byte. So now after I pull the slave select line low, I pull it high after a delay in order to receive the byte on MOSI line.
0 Kudos
Reply