I am trying to communicate with a transceiver over SPI. I am using 16 bit values to transmit data over miso and mosi. I have a sallie logic analyzer that shows that sallie is reading the right values being exchanged. However, when I try to read these values from the SPI Master I am not getting values that make sense or match the Sallie commands that are on MISO. I am using an interrupt that fires when the buffer is not empty. This value will read to a data structure.
/* Place your Interrupt code here. */
/* `#START RX_INTERUPT_Interrupt` */
TS_one->Read = SPIM_1_ReadRxData();//store response in TS2 array
/* `#END` */
I send a command like SPIM_1_WriteTxData(0x9700);
Then I want to get what comes back on MISO to be stored in TS_one->Read. I know the right data is sent back due to using Sallie. After the data is written to TS_one I will move it into a different variable and loop again.
What is the expected data and what is the data you are reading? Also, if you probe the MISO line, what is the data you see on the line? Can you also attach your project?