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.
12366 Discussions

Delay in receiving a byte in SPI slave rxbuffer

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

Hello, 

Could you post your SPI slave handler? 

May be it'll help us to understand what's happening...
Altera_Forum
Honored Contributor I
63 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.
Reply