Hi.
I have issue measure ADC value from battery.
setup is NRF52832, SDK 15.3.0, S332, using ANT+, BLE, GPIOTE, PPI, RTC, APPTIMER, LOW_PWM
my goal is measure periodically voltage using saadc.
process is timer interrupt --- ppi --- saadc.
I got value just one sampling. it was normal.
what I want is values of several times measured is averaged.
So I use burst and oversampling.
1. I saw document and if set oversampling is 8x means that sampled as fast as 2^8 and averaged the values? is it right?
2. 8x oversampling value is average of 256 sampled value?
3.
under below is code about saadc.
setting value is
resolution is 10bit
oversample is 8x
low power mode
burst enable
acqtime is 10us
input gpio is AIN0
buffer size 1
timer is 5s.
after first nrf_drv_saadc_sample_task_get() , NRF_DRV_SAADC_EVT_DONE is not triggerd.
after second nrf_drv_saadc_sample_task_get(), NRF_DRV_SAADC_EVT_DONE is triggered but value is strange. always minus value. number is random.
third times. the value is normal. it is what i want.
My opinion, it is related to double buffer? and not enough fulfilled?
if I add nrf_drv_saadc_sample func after saadc_buffer_convert in battery_init, it start second.
please give me advice
Thank you.