SAADC + TIMER (SAADCT)
The SAADC + TIMER (SAADCT) sample demonstrates timer-triggered SAADC sampling using the SAADC + TIMER (SAADCT) driver driver.
Requirements
The sample supports the following development kits:
Hardware platforms |
PCA |
Board name |
|
|---|---|---|---|
PCA10156 |
|
||
PCA10175 |
|
The sample also requires analog inputs connected to the configured SAADC channels.
Overview
An external TIMER instance triggers the SAADC sample task through GPPI at the configured sample rate. The sample configures two single-ended channels and collects series of interleaved channel samples in a memory slab. For each series, the sample logs the first and the last sample, and reports the total number of series and driver callbacks at the end of the measurement.
Building and running
This sample can be found under samples/saadct 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 that the sample logs the samples of the consecutive series and the summary of the measurement.
Sample output
The following output is displayed in the console:
SAADCT sample start
Stop requested, pending series: 1
series[0]: first=0x0146 last=0x0148
series[1]: first=0x0147 last=0x0146
Measurement finished, series read: 10, callbacks: 11
Dependencies
This sample uses the following nRF Connect SDK driver: