Working on 52832, with SoftDevice S132, SDK 17.0.2
Our boards have external 32MHz crystal as the source of HFCLK.
Our application samples the ADC periodically using the NRFX_SAADC_API_V2.
Codes look like this:
// config saadc
nrfx_saadc_adv_config_t saadc_adv_config = {
.oversampling = NRF_SAADC_OVERSAMPLE_DISABLED,
.burst = NRF_SAADC_BURST_DISABLED,
.internal_timer_cc = 1040,
.start_on_end = false,
};
nrfx_saadc_advanced_mode_set(1,
NRF_SAADC_RESOLUTION_12BIT,
&saadc_adv_config,
saadc_event_handler);
// set buffer
nrfx_saadc_buffer_set(m_saadc_sample_buffer, 256);
// trigger SAADC
err_code = nrfx_saadc_mode_trigger();
As we measure the sampling period of the 256 samples (raise a GPIO pin in NRFX_SAADC_EVT_READY event, and turn it off in NRFX_SAADC_EVT_DONE, measure the interval), the period appears not consistent among several boards. We observed about 1% differences among boards.
Reading the DevZone posts saying the Softdevice will turn on and off the external crystal so wondering if this is the cause of the deviations.
Any suggestion on this issue? Our application requires an accurate sampling period and 1% difference is not likely acceptable.
Thanks!