This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to control multiple Slave select pins using the same MISO, MOSI and SCLK pins in nRF52840?

Hi. I am using three different device which can communicate with the nRF52840 through SPI.

I am using nRF52840 as master and the three device as slave. All the device will be using the same MISO, MOSI and SCLK but different slave select.

How do I configure different slave select in nRF52840? Currently, I am using the SPI example but no luck figuring out.

I will appreciate the help.

Thank you.

Parents
  • Yes, if you want the SCLK to be separate then use 3 instances of the SPIM. Note that this would require that you use different pins for MOSI and MISO as only one peripheral can drive a pin at a time. You could of course connect them externally together. You could also initialize, and then de initialize between each time you change SPI instance if you want to only use MISO and MOSI. But it has it disadvantages. 

    Also note that SPIM3 has an errata

Reply
  • Yes, if you want the SCLK to be separate then use 3 instances of the SPIM. Note that this would require that you use different pins for MOSI and MISO as only one peripheral can drive a pin at a time. You could of course connect them externally together. You could also initialize, and then de initialize between each time you change SPI instance if you want to only use MISO and MOSI. But it has it disadvantages. 

    Also note that SPIM3 has an errata

Children
No Data
Related