Unable to set the SPI CS continuous level on the S32K148 SPI PAL

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

Unable to set the SPI CS continuous level on the S32K148 SPI PAL

932 Views
Leon06
Contributor III

Hi all,

Now I am using S32K148, S32DS and SDK 4.0.3.

I am using the SPI PAL to generating code, but there is no textbox to setting the CS pin being continuously LOW.

Leon06_1-1686029279214.png

I am unable to set the CS pin being continuous LOW for the daisy chain purpose.

Leon06_0-1686028766222.png

If I want to set the CS keeping LOW during the 6 dataframes transferred by SPI PAL setting, any SPI configurations should I set?

Regards,

Leon

 

0 Kudos
5 Replies

916 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Leon,

I did not find a setting for CS continuous mode in the S32CT. Have you tried to change the code in SPI_MasterInit? lpspiConfig.isPcsContinuous = true;

SPI_MasterInit lpspiConfig.isPcsContinuous.jpg


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

909 Views
Leon06
Contributor III

Hi Robin,

Yes, I have tried to change "lpspiConfig.isPcsContinuous = true;", but it has been effected the other channels I don't want to do this setting.

Also in my past experiences, the SDK auto-generated code I would not do any edited. I just call the functional driver to implement into my project to use.

So if I only want SPI channel 1 to be CS continuous, how could I edit these setting. 

Regards,

Leon

 

0 Kudos

777 Views
cuongnguyenphu
NXP Employee
NXP Employee

Hi @Leon06 ,
Currently, "lpspiConfig.isPcsContinuous = true;" will effect to all channels in 1 instance of LPSPI.
So the solution I think you can config SPI channels with difference instances, like below:
  

cuongnguyenphu_0-1688633792642.png

Configure 2 SPI_PAL_Component, each component will config for 1 LPSPI instance

The SDK auto-generated code I would not do any edited -> The default source code is set PcsContinuous = false, but it can be changed as user required:

cuongnguyenphu_0-1688640086956.png

 

And also, change the config g_lpspiStatePtr[instance]->isPcsContinuous == true before call SPI transfer command:

cuongnguyenphu_0-1688636191215.png

 

 

After setting SPI instance, CONTC bit of TCR register of corresponding LPSPI instance will be set

 

 



0 Kudos

763 Views
Leon06
Contributor III
 
These examles that you show, I have tried that before.
 
What I want is that when creating the new instance and could be setting the PcsContinuous status at the same time. It could be made easier to understand and use.
 
Thank you!!
Leon
0 Kudos

754 Views
cuongnguyenphu
NXP Employee
NXP Employee

Another way I could think about is the workaround as below, but you must modify  SPI_MasterInit():
1. Define the PscContinuos setting for SPI instances:
   For example: bool PcsContinuos[NUM_OF_SPI_INSTANCE] = {True, True, True, True}
2. Modify SPI_MasterInit():
   

cuongnguyenphu_0-1688725231437.png


Currently in S32CT we don't provide feature to select PcsContinuos as user needed. So these ways are some workaround you can refer.

I raised an improvement request for development team to add option for PcsContinuos in S32CT in releases in the future

 

0 Kudos