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.
I am unable to set the CS pin being continuous LOW for the daisy chain purpose.
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
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;
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.
-------------------------------------------------------------------------------
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
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:
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:
And also, change the config g_lpspiStatePtr[instance]->isPcsContinuous == true before call SPI transfer command:
After setting SPI instance, CONTC bit of TCR register of corresponding LPSPI instance will be set
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():
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