iMX RT1064 LPSPI Manually Control Chip Select

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

iMX RT1064 LPSPI Manually Control Chip Select

跳至解决方案
1,689 次查看
superspud9
Contributor II

Hi,

I am using LPSPI4 on an imx RT1064 custom board, and this SPI bus is shared between 3 devices.  2 of the devices have their CS line connected the designated chip select IOs, but the third peripheral is not.

ie. device 1 connected with PCS0, and device 2 connected with PCS3

The final device's chip select is connected to a GPIO that is not PCS1 or PCS2.

Is it possible to use the LPSPI peripheral without specifying one of the 4 available chip selects?

ie. Can I manually control the chip select for this device.  Toggle it low when before I initiate a transfer, and toggle it high after the transfer is complete?

Thanks

0 项奖励
回复
1 解答
1,680 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @superspud9 ,

   Answer your questions:

The final device's chip select is connected to a GPIO that is not PCS1 or PCS2.

Is it possible to use the LPSPI peripheral without specifying one of the 4 available chip selects?

ie. Can I manually control the chip select for this device.  Toggle it low when before I initiate a transfer, and toggle it high after the transfer is complete?

Answer:

Yes, you can use the GPIO toggle as the PCS pin to select the SPI slave.

Just add the GPIO code, and in the code, before you transfer the SPI data, pull the GPIO from high to low. After transfer is finished, pull the GPIO from low to higher.

It's totally the normal usage.

 

Wish it helps you!

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,402 次查看
Amms
Contributor I

We are using FLEXSPI B from NXP Chip – IMXRT1024DAG5A and this SPI bus is shared between 2 devices. One of the devices has its CS line connected to the designated chip select (CS) IOs i.e. GPIO_SD_B1_05.

But we are not able to use other CS - GPIO_SD_B0_01, as this pin has been already utilized for some other device.

 

Currently, we are mapping GPIO_SD_B0_06 as CS for this second device; but this is not FLEXSPI_B_SS0_B or FLEXSPI_B_SS1_B.

 

Can you or NXP technical team please confirm whether we can still use above GPIO as CS by toggling it low before data transfer and then high after data transfer is complete?

Please let us know the same.

 

0 项奖励
回复
1,681 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @superspud9 ,

   Answer your questions:

The final device's chip select is connected to a GPIO that is not PCS1 or PCS2.

Is it possible to use the LPSPI peripheral without specifying one of the 4 available chip selects?

ie. Can I manually control the chip select for this device.  Toggle it low when before I initiate a transfer, and toggle it high after the transfer is complete?

Answer:

Yes, you can use the GPIO toggle as the PCS pin to select the SPI slave.

Just add the GPIO code, and in the code, before you transfer the SPI data, pull the GPIO from high to low. After transfer is finished, pull the GPIO from low to higher.

It's totally the normal usage.

 

Wish it helps you!

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

0 项奖励
回复