# How to calculate ADC delay time?

Hello,
I can see below two definitions in the rsl10_calibrate_power.h
How to calculate those values if my device’s SYSCLK is 8MHz and uses ADC_PRESCALE_200 like below?

``````/* ----------------------------------------------------------------------------
* Constant Definitions
* ----------------------------------------------------------------------------
* Assumptions: SYSCLK = 16 MHz, ADC = low frequency mode (SLOWCLK = 1 MHz)
* ------------------------------------------------------------------------- */
/* 3 times the length of time corresponding to the minimum sample rate,
* which is deemed sufficient to allow the ADC to stabilize */

/* Corresponds to sample rate of the ADC as configured (100 Hz) */
``````

Thanks,
Calvin

@Calvin

I wanted to let you know that we are still looking into this one on our end, I will share the relevant information here.

@Calvin

Let’s have a look at the function

``````Calibrate_Power_MeasureSupply(uint32_t *adc_ptr)
``````
``````/* ----------------------------------------------------------------------------
* IFunction     : static uint32_t Calibrate_Power_MeasureSupply
* ----------------------------------------------------------------------------
* Description   : Measure a supply voltage; returns the median measurement of
*                 3 measurements to ensure that we're rejecting sampling noise
* Outputs       : return value        - Median measurement from the ADC
*                                       data register
* Assumptions   : Calibrate_Power_Initialize() has been called.
* ------------------------------------------------------------------------- */
``````

So we could see the purpose is for rejecting sample noise.
We collect 3 measurement value in different time periods.

``````    uint32_t supply1 = 0;
uint32_t supply2 = 0;
uint32_t supply3 = 0;
``````

There are two delay time period.

You can select your own value which is over minimum sample rate.
For example T1 for supply1; T2 for supply2 and T3 for supply3 — purpose is for rejecting sample noise!

For example: power on, we call this function, so we need have a long time to make sure everything ready like VBAT etc. for the first time measurement.

/* Three times the length of time corresponding to the minimum sample rate, /
/
which is deemed sufficient to allow the LSAD to stabilize */

#define STABILIZATION_DELAY (SystemCoreClock * 3 / 625)