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

52832 ADC just do samle one time

Hi,

I'm using the ADC of nRF52832 on nRF5 SDK V12.2. The setting as attachment. I found that it just do sample one time. But I have use timer to call nrf_drv_saadc_sample() to the SAADC sample task every second. However, I just can see one adc result and the result is correct. Could you help me have a look? Thanks.

ADC.txt

main.c

Parents
  • I can't see anything in particular that should stop the sampling after one sample, but you should try checking all error codes, to make sure no functions return errors:

    In battery_voltage_timeout_handler(), check the error code from nrf_drv_saadc_sample():

    uint32_t err_code = nrf_drv_saadc_sample(); //Trigger the SAADC SAMPLE task
    APP_ERROR_CHECK(err_code);
    

    You should also check error codes on calls to app_timer_create and app_timer_start.

Reply
  • I can't see anything in particular that should stop the sampling after one sample, but you should try checking all error codes, to make sure no functions return errors:

    In battery_voltage_timeout_handler(), check the error code from nrf_drv_saadc_sample():

    uint32_t err_code = nrf_drv_saadc_sample(); //Trigger the SAADC SAMPLE task
    APP_ERROR_CHECK(err_code);
    

    You should also check error codes on calls to app_timer_create and app_timer_start.

Children
No Data
Related