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 use APP_TIMER_DEF(m_battery_voltage_id);to creat a timer and then I use nrf_drv_saadc_sample() to trigger the ADC to sample when the timer timeout. The SAADC_SAMPLES_IN_BUFFER is 1, I also try other number such as 5, but the result is the same. I know the code is runing well ,because the timer is running all the time and I will prinf a debug information when timer timeout.

Reply
  • I use APP_TIMER_DEF(m_battery_voltage_id);to creat a timer and then I use nrf_drv_saadc_sample() to trigger the ADC to sample when the timer timeout. The SAADC_SAMPLES_IN_BUFFER is 1, I also try other number such as 5, but the result is the same. I know the code is runing well ,because the timer is running all the time and I will prinf a debug information when timer timeout.

Children
No Data
Related