AnsweredAssumed Answered

SPI problem NucleoF401<->TI Launchpad

Question asked by ahmed.salman.003 on Mar 11, 2015
Latest reply on Mar 12, 2015 by ahmed.salman.003
Hello,

I am having a little problem with my SPI between the nucleo board and the TI cc3200 launchpad.

I have been using the SPI communication without any problem under the following configuration
TI- Slave
Nucleo-Master

Now I have reversed the roles and I cant seem to get a proper response from the Slave(nucleo).
e.g)I put the value 0x08 in the nucleo SPI_TX register.From the master I send a value (0x50).I am able to get and read this data on the slave RX reg and its correct.This transmission should push out the 0x08 value from the slave to master but on the master side I'm reading 0xC0.

Every time I'm able to receive the data on the slave correctly but the master doesnt get the data stored in slave's SPI TX register. 
This is the code I'm using on the slave side
01.recv_data[0]=    SPIsend(0x08);
02. 
03. 
04.unsigned short SPIsend(unsigned short data)
05.{
06.    SPI1->DR=data;
07.while(!(SPI1->SR & SPI_SR_TXE));
08.     
09.    while(!(SPI1->SR & SPI_SR_RXNE));
10.     
11.while (SPI1->SR & SPI_SR_BSY);
12. 
13.    return (SPI1->DR);
14.    }
The SPI word length on both side is 16bits wide.
Clk polarity and phase settings are the same on both sides.These were the same settings I used when I was sending data from nucleo to TI successfully.

Any help would be appreciated.

Outcomes