iMX RT1064 LPSPI Manually Control Chip Select

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX RT1064 LPSPI Manually Control Chip Select

Jump to solution
1,690 Views
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 Kudos
Reply
1 Solution
1,681 Views
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

 

View solution in original post

0 Kudos
Reply
2 Replies
1,403 Views
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 Kudos
Reply
1,682 Views
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 Kudos
Reply