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 |
|
|---|---|---|---|
nRF9251 DK |
nrf9251dk |
|
|
nRF54LV10 DK |
PCA10188 |
|
|
nRF54LS05 DK |
PCA10214 |
nrf54ls05dk |
|
PCA10184 |
|
||
nRF54LC10 DK |
PCA10226 |
nrf54lc10dk |
|
PCA10156 |
|
||
PCA10175 |
|
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:
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 listcommand. Alternatively, check your operating system’s device manager or its equivalent.Connect to the kit with a terminal emulator (for example, the Serial Terminal app). See Testing and optimization for the required settings and steps.
Observe reports about number of completed transfers and the CPU load.
Connect the logic analyzer to the SPI pins, to confirm SPI activity.
Optionally, measure the current to get average current for various periods.
Dependencies
This sample uses the following libraries: