Hi,
I am trying to communicate with CC1310 and FXTH87xx11 sensor card via SPI, but it does not work. FXTH87xx11 module "MASTER" CC1310 module works as "SLAVE".
I can see the signals coming out of the CLK, MOSI, SS pins on the FXTH87xx11 side very well when I look through the oscilloscope.
The SPI settings I made for CC1310 are as follows.
SPI_Params_init(&spiParams);
spiParams.frameFormat = SPI_POL0_PHA0;
spiParams.mode = SPI_SLAVE;
spiParams.transferMode = SPI_MODE_CALLBACK;
spiParams.transferCallbackFxn = transferCallback;
spiParams.dataSize = 8; //8bit
//spiParams.bitRate = 1000000; //1Mhz
// Configure the transaction
transaction.count = 8;
transaction.txBuf = Buf;
transaction.rxBuf = Buf;
I cannot make any settings on the FXTH87xx11 side, the module does not allow me to do this, I use the "TPMS_MSG_INT, TPMS_MSG_READ, TPMS_MSG_WRITE" definitions given to me there.
Where am I doing wrong or what am I missing? Can you help me with this?
Solved! Go to Solution.
Hi Ali,
The SPI communication implemented with the TPMS_MSG routines is a 3-wire SPI, so with data read and written on the same line. So on the slave SPI side, the bidirectional data option must be enabled.
If using a 4-wire SPI is simpler, drivers implementing a 4-wire SPI master are available in this demo package:
That can be downloaded from:
Best regards,
Tomas
Hi Tomas,
Problem solved thank you for your help Tomas.
The reason for the problem is that the "transaction.count" value on the CC1310 side was given incorrectly.
Best regards,
Ali
I tried the code you suggested and I managed to see the output I wanted from CLK, MOSI, SS pins. I can see the values that I sent via FXTH on the CC1310 module, but the places of the values I sent after the first value get mixed up.I've experienced this before because it was doing when the correct communication speed was not available.I could not find the communication speed of FXTH anywhere but when I look through the oscilloscope, it turns out to be 38.46kHz.
How can I find the communication speed of FXTH?
The SPI settings I made for CC1310 are as follows.
SPI_Params_init(&spiParams);
spiParams.frameFormat = SPI_POL0_PHA0;
spiParams.mode = SPI_SLAVE;
spiParams.transferMode = SPI_MODE_CALLBACK;
spiParams.transferCallbackFxn = transferCallback;
spiParams.dataSize = 8; //8bit
spiParams.bitRate = 38460;
// Configure the transaction
transaction.count = 8;
transaction.txBuf = NULL;
transaction.rxBuf = Buf;
Hi Ali,
We do not specify the baud rate of the SPI communication as this does not need to be configured on the slave side.
I think you did not configure the CPHA correctly. It should be CPHA=1 and it looks like you configured CPHA=0.
Information on the simulated SPI interface can be found in the firmware user guide:
I hope this helps.
Best regards,
Tomas
Hi Tomas,
Considering what you said, I changed it to CPHA = 1 but the problem still persists.
I use 4 pin SPI structure as a structure.
The value I send is getting mixed up as seen in the pictures below.
FXTH Value:
Xfer_TxBuffer[index++] = (UINT8)1;
Xfer_TxBuffer[index++] = (UINT8)2;
Xfer_TxBuffer[index++] = (UINT8)3;
Xfer_TxBuffer[index++] = (UINT8)4;
Xfer_TxBuffer[index++] = (UINT8)5;
Xfer_TxBuffer[index++] = (UINT8)6;
Xfer_TxBuffer[index++] = (UINT8)7;
Xfer_TxBuffer[index++] = (UINT8)8;
Values to CC1310
Every once in a while, the value I send is coming right.
Current CC1310 Settings
Best regards,
Hi Ali,
The SPI communication implemented with the TPMS_MSG routines is a 3-wire SPI, so with data read and written on the same line. So on the slave SPI side, the bidirectional data option must be enabled.
If using a 4-wire SPI is simpler, drivers implementing a 4-wire SPI master are available in this demo package:
That can be downloaded from:
Best regards,
Tomas
Hi Tomas,
Thank you for your reply, I will try and return as soon as possible.