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
  • Hi Alice,

    I see you use low power mode in the SAADC driver. There is some issues with this mode in SDK 12.x.0 driver. You should use the driver (nrf_drv_saadc.c) from SDK 13 instead. I tested this whit your code, and it seems to solve the issue. I would also suggest that you enable burst mode in saadc_init() if using oversample, to avoid having to wait for multiple calls to nrf_drv_saadc_sample() to get one result:

    channel_config.burst = NRF_SAADC_BURST_ENABLED;
    

    Best regards,

    Jørgen

Reply
  • Hi Alice,

    I see you use low power mode in the SAADC driver. There is some issues with this mode in SDK 12.x.0 driver. You should use the driver (nrf_drv_saadc.c) from SDK 13 instead. I tested this whit your code, and it seems to solve the issue. I would also suggest that you enable burst mode in saadc_init() if using oversample, to avoid having to wait for multiple calls to nrf_drv_saadc_sample() to get one result:

    channel_config.burst = NRF_SAADC_BURST_ENABLED;
    

    Best regards,

    Jørgen

Children
Related