S32K144 Choose alternate SPI pin

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K144 Choose alternate SPI pin

ソリューションへジャンプ
1,636件の閲覧回数
ruihang_wu
Contributor III

Is there anyway to choose CS pins that are not in the SPI config dialogue?

For example if I choose instance 0 CS0 has the option to be PTB0 or PTB5, CS1 can only be PTB5. Is there a way to set either one to a different pin other than the ones in the dropdown?

Screenshot 2020-10-15 115718.png

0 件の賞賛
返信
1 解決策
1,629件の閲覧回数
mariuslucianand
NXP Employee
NXP Employee

Hello @ruihang_wu ,

All the pins displayed in the PCS dropdowns are pins that can be directly controlled by the LPSPI peripheral. So when you want to transfer bytes to a slave device, the hardware will automatically set the PCS pin to low and after the transfer is completed, the pin is set back to High state.

If you want to use the LPSPI as Master and another pin as PCS, that the ones that can be controlled by the hardware, then you have to use a GPIO block to manually select the slave device, and to use a Blocking transfer. Something like this:

mariuslucianand_0-1602785175462.png

But you have to set the blocks priorities in order to be sure that the code is generated in this way. The pin sets low before transfer, actual transfer take place and the pin is set back to High (this is the Active low scenario).

I don't think that this scenario applies for the LPSPI configured as slave. For that case you have to use a hardware controlled PCS.

Hope this helps,

Marius

 

 

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,630件の閲覧回数
mariuslucianand
NXP Employee
NXP Employee

Hello @ruihang_wu ,

All the pins displayed in the PCS dropdowns are pins that can be directly controlled by the LPSPI peripheral. So when you want to transfer bytes to a slave device, the hardware will automatically set the PCS pin to low and after the transfer is completed, the pin is set back to High state.

If you want to use the LPSPI as Master and another pin as PCS, that the ones that can be controlled by the hardware, then you have to use a GPIO block to manually select the slave device, and to use a Blocking transfer. Something like this:

mariuslucianand_0-1602785175462.png

But you have to set the blocks priorities in order to be sure that the code is generated in this way. The pin sets low before transfer, actual transfer take place and the pin is set back to High (this is the Active low scenario).

I don't think that this scenario applies for the LPSPI configured as slave. For that case you have to use a hardware controlled PCS.

Hope this helps,

Marius

 

 

0 件の賞賛
返信