Hi Speedy Speedy,
Did you check the SPI communication wave between the K82 and your Arduino?
Please check the wave, whether the K82 really send out the wrong data?
Please also check the code, you should make sure your K82 code also send out the data which you want.
I found in your attached code, you wrote the code like this:
slaveXfer.txData = slaveTxData;
slaveXfer.rxData = slaveRxData;
slaveXfer.dataSize = TRANSFER_SIZE;
slaveXfer.configFlags = kDSPI_SlaveCtar0;
DSPI_SlaveTransferNonBlocking(EXAMPLE_DSPI_SLAVE_BASEADDR, &g_s_handle, &slaveXfer);
if(slaveRxData[0] != 0)
{
PRINTF("%u", slaveRxData[0]);
PRINTF("\r\n");
delay(8000000);
}
slaveTxData[0] = 0x97;
slaveRxData[0] = 0;
If you want the slave K82 send 0X97, you shold put the
slaveTxData[0] = 0x97;
slaveRxData[0] = 0;
Before :
slaveXfer.txData = slaveTxData;
slaveXfer.rxData = slaveRxData;
slaveXfer.dataSize = TRANSFER_SIZE;
slaveXfer.configFlags = kDSPI_SlaveCtar0;
Please modify the code and try again.
If you still can't get the correct data, please also send me your SPI communication wave, with oscilloscope or logic analyzer.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------