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

Writing to Multiple SPI Devices in Parallel

Hi, 

    We have a requirement to connect a SPI device to each SPI interface present on nRF52840, and we want to write to those multiple devices in parallel. Is there any API available they could let us write to those SPI devices connected to different SPI interfaces in parallel? You answer will be highly appreciated.

Best regards,

Omer 

Parents
  • Thanks. Let's take an example. We suppose that I have two devices A and B. I want to connect A on SPI interface 1 and B to SPI interface 2. I want to write 0x01 to A and 0x02 to B in parallel. From your reply it seems that I can't do it in parallel, rather what I can do is to call nrfx_spim_xfer device twice first with data buffer containing value 0x01 and then call it again with data buffer containing value 0x02. This means we can only do sequential write and parallel writes are not possible in this case?

    Best regards,

    Omer

  • The driver can't write in parallel but the HAL can with the aid of the PPI and EGU. 

    The idea is to intitialize the SPIM's and their buffers, and then trigger the TASKS_START in all SPIM's at the same time via the PPI system. 

    In order to trigger 2 tasks from one SW call you need to use the EGU — Event generator unit to generate a PPI event, this PPI event can then be 'forked' to the two SPIM's START tasks. 

Reply Children
No Data
Related