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

Changing the SPI Modes

The design has 2 sensors on SPI with mode 3 and the nrf21540 which is mode 0.  Can you have 2 different Modes on the same spi bus?

would i use the SPI transaction manager library to accomplish this?

do i need to enable and disable the spi bus to change the configuration?

Or should we move the nrf21540 to another SPI bus since the mode is different?

Parents
  • Hi,

    Each assigned SPI pin can only be driven by one instance of the SPI peripheral at a time. You would therefore have to either move the nRF21540 to other pins, or you could use the same pins and reinitialize the SPI bus between each time you need to switch modes. You can use the transaction manager to do this, see the documentation on the transaction manager which highlights how you can schedule transfers with different HW settings.

    You can also use the lower level SPI driver, and just re-initialize the module with the appropriate SPI mode between each transfer.

    best regards

    Jared 

Reply
  • Hi,

    Each assigned SPI pin can only be driven by one instance of the SPI peripheral at a time. You would therefore have to either move the nRF21540 to other pins, or you could use the same pins and reinitialize the SPI bus between each time you need to switch modes. You can use the transaction manager to do this, see the documentation on the transaction manager which highlights how you can schedule transfers with different HW settings.

    You can also use the lower level SPI driver, and just re-initialize the module with the appropriate SPI mode between each transfer.

    best regards

    Jared 

Children
No Data
Related