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

What is the SAADC Maximum sampling rate for nRF52810?

I am developing a NIR (Near-Infrared) product using nRF52810.
I use 15.3 for SDK and S112 for Softdevice.
I implemented ADC (saadc) function based on ble_app_uart.

I have to read 2 ADC channels at 62.5KHz (16usec) for NIR measurement.

I made a test code and tried it out.
However, if nrf_drv_saadc_sample () is called 100 times in 62.5KHz (16usec), saadc_callback (nrf_drv_saadc_evt_t const * p_event) is rarely performed.

If nrf_drv_saadc_sample () is called 100 times in approximately 1KHz (1,000 usec) units, saadc_callback (nrf_drv_saadc_evt_t const * p_event) is performed 100 times.

As a result of my measurement test, the maximum sampling rate for ADC 2 channels is 1KHz (1,000usec).
That is, the maximum sampling rate is too slow for NIR measurement.

Looking at the nRF52810 datasheet, the SAADC Maximum sampling rate is 200KHz.

How can I read ADC 2channel in 62.5KHz (16usec) unit?

My test code is here.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "nrf.h"
#include "nrf_drv_saadc.h"
#include "nrf_drv_ppi.h"
#include "nrf_drv_timer.h"
#include "boards.h"
#include "app_error.h"
#include "nrf_delay.h"
#include "app_util_platform.h"
#include "nrf_pwr_mgmt.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#include "nir_meas.h"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

In the code above, I set TIMER to 1,000usec.
When timer_handler is called 100 times (count_num = 100), saadc_callback (cnt_cnt = 100). It is OK.
So, as a result of my testing, the maximum sampling rate is 1KHz.

Set TIMER to 1000usec or less,
If timer_handler is called 100 times (count_num = 100), saadc_callback is executed 80-90 times.
(cnt_cnt <100).

Additional comments:
Ultimately, I want to use a method to call nrf_drv_saadc_sample () through an external interrupt input pin in 62.5KHz.
So the timer routine in the current code is also using the method to call nrf_drv_saadc_sample ().

Thank you.