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

SPI manually select CS pin

Hello ! How can I configure nrf_drv_spi with me writing the CS pin to LOW and HIGH whenever I want to address a different peripheral ?

Parents Reply
  • Generally just enabling the CS pin all the time can cause problems

    Often the protocol for peripherals involves sending 1 or 2 byes with a register address, followed by writing or reading multiple bytes

    However, devices often rely on CS going low to indicate that a new transfer is about to take place and that the next data from the MCU is a command e.g. READ REGISTER

    You should check the data sheet for the peripheral you are using, to make absolutely sure it allows CS to be enabled all the time

    (Personally I would not do this, because if you get out of sync you will be sending or receiving garbage , to or from the peripheral

Children
Related