S32K Chip Select

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32K Chip Select

跳至解决方案
2,451 次查看
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

 

标记 (2)
0 项奖励
回复
1 解答
2,423 次查看
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 项奖励
回复
3 回复数
2,441 次查看
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 项奖励
回复
2,432 次查看
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 项奖励
回复
2,424 次查看
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 项奖励
回复