How can I assign a new Slave Select Pin to the SPI?

if i am controlling two spi devices with one instance, can I just define a new SS in the same SPIconfiguration or do i have to close the connection and select a new one?

is it possible to control the second SPI while the first one is waiting to receive data?

if not, can i use another spi instance or do both Instances are clock connected?

Using

NRF52832
PCA10040

using SPIM and the newest library version

Parents
  • Hello,

    if i am controlling two spi devices with one instance, can I just define a new SS in the same SPIconfiguration or do i have to close the connection and select a new one?

    I am not entirely sure what you mean when you say close the connection, but you could toggle the SS pin as a GPIO, to control which device on the SPI bus that receives the transfer.

    is it possible to control the second SPI while the first one is waiting to receive data?

    Could you elaborate on what you mean by this as well?
    Only one slave may be active on MISO at the same time - so unless there is a waiting period in between transfers in which you release the SS of the first device, and then toggle the SS of the second device, then this is not possible, no.
    Slave devices will only listen for messages on the bus when their SS is active.

    if not, can i use another spi instance or do both Instances are clock connected?

    You may indeed use a separate SPI instance for each device, just duplicate the setup and configuration for your previous SPIM instance and change the pin configuration.
    You could also have multiple SPI devices on the same SPI bus, but as mentioned you will need to control which of the devices you are targeting by selecting their SS pin.

    Best regards,
    Karl

  • perfect! thank you very much! i will let you know how it goes! (this, of course is the answer to the last comment)

  • perfect! thank you very much!

    No problem at all, I am happy to help! :) 

    i will let you know how it goes!

    Great, I look forward to hearing about it!

    Please do not hesitate to open another ticket if you should encounter any issues or questions in the future.

    Good luck with your development!

    Best regards,
    Karl

Reply Children
No Data
Related