Possibility to use SPI manual software chip select

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

Possibility to use SPI manual software chip select

跳至解决方案
2,881 次查看
Othmane1
Contributor II

I am trying to communicate with the TLE94103 component using SPI (LPSPI0), is it possible to use some pin that has the GPIO function to operate as a chip-select pin and use the other SPI pins (CLK, MOSI, and MISO) in their usual pins that have the functionalities for SPI? 

and if I want to send and receive I am gonna first set the chip select GPIO to low and then set it to high after sending/receiving

is this possible?

0 项奖励
回复
1 解答
2,869 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Othmane1,

You did not specify the part number.

But yes, this is possible.

The CS selected in the LPSPI module does not have to be routed to a pin.

A GPIO can be used instead, but it would be your responsibility to assert and deassert the GPIO.

Why do you need that?

The LPSPI module allows configuring the PCS delays, frame size etc, it also allows continuous transfers with the CS asserted over multiple frames.

 

Regards,

Daniel

 

在原帖中查看解决方案

0 项奖励
回复
4 回复数
2,695 次查看
elb1
Contributor III

Hello, I have the same question but for different microcontrolller, is this (use chip select as gpio) also possible for mpc5748g ?
thank you

0 项奖励
回复
2,692 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @elb1,

Yes, this is the same, the CS of the SPI module does not have to be used, it can be controlled by a GPIO.

If you have any questions on mpc5748g, please create a new thread in the MPC5xxx community:

https://community.nxp.com/t5/MPC5xxx/bd-p/mpc5xxx

 

Regards,

Daniel

0 项奖励
回复
2,680 次查看
elb1
Contributor III

Okey thank you for your response

0 项奖励
回复
2,870 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @Othmane1,

You did not specify the part number.

But yes, this is possible.

The CS selected in the LPSPI module does not have to be routed to a pin.

A GPIO can be used instead, but it would be your responsibility to assert and deassert the GPIO.

Why do you need that?

The LPSPI module allows configuring the PCS delays, frame size etc, it also allows continuous transfers with the CS asserted over multiple frames.

 

Regards,

Daniel

 

0 项奖励
回复