PPI Sequencer with SPI

The PPI Sequencer with SPI sample presents how to use PPI Sequencer for I2C/SPI driver.

Requirements

The sample supports the following development kit:

Hardware platforms

PCA

Board name

Board target

nRF9251 DK

nrf9251dk

nrf9251dk/nrf9251/cpuapp

nRF54LV10 DK

PCA10188

nrf54lv10dk

nrf54lv10dk/nrf54lv10a/cpuapp

nRF54LS05 DK

PCA10214

nrf54ls05dk

nrf54ls05dk/nrf54ls05b/cpuapp nrf54ls05dk/nrf54ls05a/cpuapp

nRF54LM20 DK

PCA10184

nrf54lm20dk

nrf54lm20dk/nrf54lm20b/cpuapp nrf54lm20dk/nrf54lm20a/cpuapp

nRF54LC10 DK

PCA10226

nrf54lc10dk

nrf54lc10dk/nrf54lc10a/cpuapp

nRF54L15 DK

PCA10156

nrf54l15dk

nrf54l15dk/nrf54l15/cpuapp

nRF54H20 DK

PCA10175

nrf54h20dk

nrf54h20dk/nrf54h20/cpuapp

Overview

The sample is using PPI Sequencer for I2C/SPI to perform periodic SPI transfers, which are triggered by PPI. The CPU is woken up after the completion of every 16 transfers. The sample runs the sequence of SPI transfers using various periods, ranging from 1 ms to 100 ms.

Configuration

See Configuring and building for information about how to permanently or temporarily change the configuration.

Building and running

This sample can be found under samples/peripheral/ppi_seq_spi in the nRF Connect SDK folder structure.

To build the sample, follow the instructions in Building an application for your preferred building environment. See also Programming an application for programming steps and Testing and optimization for general information about testing and debugging in the nRF Connect SDK.

Note

When building repository applications in the SDK repositories, building with sysbuild is enabled by default. If you work with out-of-tree freestanding applications, you need to manually pass the --sysbuild parameter to every build command or configure west to always use it.

Testing

After programming the sample to your development kit, complete the following steps to test it:

  1. Connect the kit to the computer using a USB cable. The kit is assigned a serial port. Serial ports are referred to as COM ports on Windows, /dev/ttyACM devices on Linux, and /dev/tty devices on macOS. To list Nordic Semiconductor devices connected to your computer together with their serial ports, open a terminal and run the nrfutil device list command. Alternatively, check your operating system’s device manager or its equivalent.

  2. Connect to the kit with a terminal emulator (for example, the Serial Terminal app). See Testing and optimization for the required settings and steps.

  3. Observe reports about number of completed transfers and the CPU load.

  4. Connect the logic analyzer to the SPI pins, to confirm SPI activity.

  5. Optionally, measure the current to get average current for various periods.

Dependencies

This sample uses the following libraries: