SAADC: Switching Channels or reading simultaneously

Hi there,

I was following the tutorial here https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-6-analog-to-digital-converter-adc/topic/exercise-3-interfacing-with-adc-using-nrfx-drivers-and-timer-ppi/ and it worked perfectly. 

However, for my use case, I need to measure a signal at channel 0 not often (say once every minute) and another signal continuously with a high frequency at channel 1. E.g. measure VDD at channel 0 and some signal from a sensor on channel 1. 

I am a bit lost, since I didn't find any documentation/thread on dev zone on how to switch between two channels and just calling 'nrfx_saadc_advanced_mode_set again' didn't seem to work. I tried to measure them simultaneously (not my use case, but at least a somewhat dirty solution) by using:
nrfx_saadc_advanced_mode_set(BIT(0) | BIT(1),
NRF_SAADC_RESOLUTION_12BIT,
&saadc_adv_config,
saadc_event_handler);)

but this screwed with the values, when compared to measuring each channel alone.

Is there anywhere more information on how to use this driver? I was unable to find sth on the internet regarding this and https://docs.nordicsemi.com/bundle/ncs-2.6.2/page/nrfx/drivers/saadc/driver.html isn't exactly hinting on any of that.

If not, could you please give me some tips, how I would do that?  

(I used v2.6.2, the vs code extension, and currently a nrf532833 dev kit)

Best regards

Ludwig

Related