How can I SPI settings for FXTH87xx11?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I SPI settings for FXTH87xx11?

Jump to solution
1,868 Views
aliyolcu
Contributor II

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?

 

0 Kudos
1 Solution
1,842 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

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:

Capture 1.JPG

That can be downloaded from:

https://www.nxp.com/products/sensors/pressure-sensors/tire-pressure-monitoring-sensors/fxth87-tire-p...

 

Best regards,

Tomas

View solution in original post

0 Kudos
6 Replies
1,758 Views
aliyolcu
Contributor II

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

0 Kudos
1,822 Views
aliyolcu
Contributor II

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?

sinyal.PNG

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;

0 Kudos
1,786 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

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:

SPI Interface.JPG

 

I hope this helps.

Best regards,

Tomas

0 Kudos
1,782 Views
aliyolcu
Contributor II

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

aliyolcu_0-1612784937452.pngaliyolcu_1-1612784961324.pngaliyolcu_2-1612784977702.png

Every once in a while, the value I send is coming right.

Current CC1310 Settings

aliyolcu_3-1612785343479.png

Best regards,

 

 

0 Kudos
1,843 Views
TomasVaverka
NXP TechSupport
NXP TechSupport

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:

Capture 1.JPG

That can be downloaded from:

https://www.nxp.com/products/sensors/pressure-sensors/tire-pressure-monitoring-sensors/fxth87-tire-p...

 

Best regards,

Tomas

0 Kudos
1,839 Views
aliyolcu
Contributor II

Hi Tomas,

Thank you for your reply, I will try and return as soon as possible.

0 Kudos