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

Multiple instances of SPI

Hi all,

Provided the nRF52840 board implements up to 4 SPI, I would like to use at least 2 of them simultaneously.
I need to do it like this because I need one of them to be running during a certain amount of time constantly and the other one only sporadically. Both must be relatively precise, thus one running in "background" using a PPI channel would be the best solution. Sometimes the both could be active at the same time, thus, cannot share the bus.

SPI 1 will be triggered by a timer using PPI and constantly upload the read buffer.(is a callback function mandatory?)

SPI 2 I would like to trigger only after an ESB command is received. Ideally I would like the ESB to just trigger another PPI channel between a timer and SPI, but it's ok if the microcontroller needs to take active action here.

Because I want to use a PPI channel, the idea of sharing the bus and manually triggering the SS pin is difficult to implement. I'd rather use 8 pins of the board instead.

The main issue is that I can only implement SPI 1, and SPI 2 never starts. I tried using two PPI channels, triggering SPI 1 and SPI 2 with the same timer, and triggering SPI 2 with the end transfer of SPI 1 event, but to no result.

I have enabled # define SPI1_ENABLED 1  and #define SPI2_ENABLED 1.

There are several posts about this but the solutions are no longer applicable because they correspond to a different SDK or reference to dead links. All in all I could not find a suitable answer in the infocenter.

Bests,

Parents Reply Children
Related