S32K Chip Select

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
2,677件の閲覧回数
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,649件の閲覧回数
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,667件の閲覧回数
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,658件の閲覧回数
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,650件の閲覧回数
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 件の賞賛
返信