S32K Chip Select

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

S32K Chip Select

Jump to solution
1,148 Views
puc2000
Contributor II

Hello,

I´m using S32K144 LPSPI1 with SDK and try to switch the CS with

LPSPI_SetPcs(LPSPICOM1, LPSPI_PCS2);

and also with

LPSPI_DRV_MasterConfigureBus(LPSPICOM1, &lpspiCom1_MasterConfig3, NULL);

but it will always use the CS configured in the first

 

LPSPI_DRV_MasterInit(LPSPICOM1, &lspi1_state, &lpspiCom1_MasterConfig1);

 

even if I have a Config for all CS. How can I use it inside SDK?

Thanks

peter

 

Tags (2)
0 Kudos
1 Solution
1,120 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

If the only difference between Send_MasterConfig0 and Send_MasterConfig1 was the PCS selection, then I don't think you need to add Send_MasterConfig. LPSPI_SetPcs should be able to switch different PCS.

But if you want to add several Master Configurations with different configurations(not only PCS), then you may need to add Master Configuration. In this case you only need to call: LPSPI_DRV_MasterInit before transfer to another Slave.

Master Configurations.jpg

View solution in original post

0 Kudos
3 Replies
1,138 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi peter,

Did you configure PTE6 as LPSPI0_PCS2 in the PinSettings?
Test the lpspi_transfer_s32k144 SDK example, I am able to see the signal on PTE6(LPSPI0_PCS2).

lpspi_transfer_s32k144.jpg


The default setting of Peripheral Chip Select is PCS0.

lpspi0 PCS0 default.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
1,129 Views
puc2000
Contributor II

Hi Robin,

thanks for youre reply.

yes this is done ...but I have now 2 CS and 2 Configs and want to switch between CS1 and CS2.

one master -> 2 chip selects to 2 Slaves with same MOSI/MISO.

Best regards,

 

Peter

 

0 Kudos
1,121 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

If the only difference between Send_MasterConfig0 and Send_MasterConfig1 was the PCS selection, then I don't think you need to add Send_MasterConfig. LPSPI_SetPcs should be able to switch different PCS.

But if you want to add several Master Configurations with different configurations(not only PCS), then you may need to add Master Configuration. In this case you only need to call: LPSPI_DRV_MasterInit before transfer to another Slave.

Master Configurations.jpg

0 Kudos