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

SPIM - daisy chain

Hi,

I need to connect multiple SPI slaves in a daisy chain. It seems that using nrfx_spim_init once and nrfx_spim_xfer at each transfer is the simplest way to go using the DMA. I haven't found, however, a way to dynamically choose and control the CS pin before each transfer using these calls.

Please advise,

Daniel

Parents Reply
  • In terms of cpu cycles it is certainly not efficient, but unfortunately the nRF52840 SPIM HW has limited support for HW CS pin control (only supported on SPIM3) and there are no APIs in the SPIM driver that allows you to change the CS pin seamlessly. 

    What I would recommend depends on your skill level and requirements:

    1. The easiest option is to do as I suggested above. It will be simple to implement, but will waste CPU cycles and current in the long run. 
    2. If you care about efficiency and every CPU cycle counts, then you probably need to write your own driver. 

    Whether it is worth it is up to you.

     

Children
Related