Thanks in advanced. I'm using nrf52832 with nRF5_SDK_17.0.2. I try to measure adc time consuming as below:
......
static void event_handler(nrfx_saadc_evt_t const * p_event)
{
ret_code_t err_code;
switch (p_event->type)
{
case NRFX_SAADC_EVT_BUF_REQ:
Click_start = app_timer_cnt_get();
// Set up the next available buffer
err_code = nrfx_saadc_buffer_set(&BoMo_samples[next_free_buf_index()][0], ADC_CHANNELS_IN_USE);
APP_ERROR_CHECK(err_code);
break;
case NRFX_SAADC_EVT_DONE:
Click_stop = app_timer_cnt_get();
NRF_LOG_INFO("Time cost is " NRF_LOG_FLOAT_MARKER "ms.\r\n", NRF_LOG_FLOAT(1000*app_timer_cnt_diff_compute(Click_stop, Click_start)/32768.0));
......
I find when timer sample rate is 500ms, then adc time consuming is 249.ms, and when rate is 5ms, then adc time consuming is 2.47ms. It seems that adc always consumes half time of timer sample rate. I want to fix adc time consuming, is there any necessity of such 1/2 scale? Would any expert help me? Thanks again.