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
Solved! Go to Solution.
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.
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).
The default setting of Peripheral Chip Select is PCS0.
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,
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
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.