What ways are there to use one pin as chip select to connect multiple SPI as secondary devices.

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

What ways are there to use one pin as chip select to connect multiple SPI as secondary devices.

Jump to solution
2,814 Views
VolcanicCheese
Contributor III

Because for the current project I am working on the 1020 dev board, I used all the pins and do not have enough exposed pins left with. I was aiming to connect three SPI secondary devices using demultiplexer for the chip select or (Pcs). I was wondering what would be the limitation of using such method and are there any alternative solution to this problem. Thank you!

Labels (1)
0 Kudos
Reply
1 Solution
2,796 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @VolcanicCheese 

   If you pin is not enough, you can use your plan, in fact, even use the GPIO instead of the CS pin is also OK, so your external 4 by 1 demultiplexer is OK.

   About the label, please check the EVK board schematic, don't just see the board directly.

https://www.nxp.com/webapp/Download?colCode=MIMXRT1020-EVK-Design-Files

Please check the schematic to find the detail pin lable.

kerryzhou_0-1625645226667.png

 

Wish it helps you!

Best Regards

Kerry

View solution in original post

0 Kudos
Reply
6 Replies
2,809 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @VolcanicCheese 

   Do you mean, you use 3 SPI devices on your side, and need 3 SPI modules, but the LPSPI_PCS pin is not enough to use in your own application?

   Please give me more details about it, what's the demultiplexer you mean? Do you mean the chip can use one input and output 3 pins to connect two your 3 SPI devices?

  In fact, RT1020 has a lot of CS pins, all can't be used on your side?

kerryzhou_0-1625637975364.png

 

 

Best Regards,

Kerry

0 Kudos
Reply
2,806 Views
VolcanicCheese
Contributor III

I have only enough pins left for SPI1 and could only use Pcs3 (I am using the pins available from J17-J20). The other pins are used for different communication protocols. My goal was to use a 4 by 1 demultiplexer to route Pcs3 to the wanted slave SPI device. Thus, I was thinking of doing this by using one of the available GPIO to connect the demultiplexer to the sel pin label to choose among different slave SPI devices instead of choosing among different Pcs. Thank you

0 Kudos
Reply
2,804 Views
VolcanicCheese
Contributor III

With the dev board, I was not sure where to find the pin labels within the dev board outside of the pin label within j17 to j20.

0 Kudos
Reply
2,797 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @VolcanicCheese 

   If you pin is not enough, you can use your plan, in fact, even use the GPIO instead of the CS pin is also OK, so your external 4 by 1 demultiplexer is OK.

   About the label, please check the EVK board schematic, don't just see the board directly.

https://www.nxp.com/webapp/Download?colCode=MIMXRT1020-EVK-Design-Files

Please check the schematic to find the detail pin lable.

kerryzhou_0-1625645226667.png

 

Wish it helps you!

Best Regards

Kerry

0 Kudos
Reply
2,792 Views
VolcanicCheese
Contributor III

Thank you so much. Does that mean I could use any GPIO for a chip select pin?

0 Kudos
Reply
2,788 Views
kerryzhou
NXP TechSupport
NXP TechSupport

HI @VolcanicCheese 

  Of course, you also can use other RT GPIO instead of the SPI_CS hardware module pins, just before you send the SPI data, pull the GPIO low in the code to active the PCS pin, after send finished, pull GPIO high to inactive PCS pin.

   So, if you still have other GPIO pins, you even don't need to use external modules.

Best Regards,

kerry