Some questions regarding offset calibration when doing single samples (or burst mode) from multiple input pins:
-
Can SAADC offset calibration be performed after SAADC initialization (nrf_drv_saadc_init), but prior to channel initialization (nrf_drv_saadc_channel_init)? My hunch is no, since offset calibration time is dependent on the acquisition time, which is a channel-specific parameter.
-
Must the acquisition time used for offset calibration match the acq time used for the channel (or can I shorten during cal)? What are the implications of different times?
-
Does SAADC offset calibration need to be performed for each input (AINx), or does the offset apply to all input pins? i.e. If I intend to use multiple AIN inputs (AIN1, AIN2, etc), do I need to call nrf_drv_saadc_calibrate_offset for each input (after each channel initialization)?
I would like to do infrequent sampling of multiple analog inputs. I'm using one SAADC channel, and reconfiguring it with each input prior to the sample. Can I do this:
- Init SAADC (nrf_drv_saadc_init)
- Set up a bogus channel using the desired acq time for offfset cal
- Calibrate offset (nrf_drv_saadc_calibrate_offset)
- Init Channel 1 with AIN1 (nrf_drv_saadc_channel_init)
- Sample Channel 1 (nrf_drv_saadc_sample)
- Uninit Channel 1
- Init Channel 1 with AIN2 (nrf_drv_saadc_channel_init)
- Uninit Channel 1
- ...Repeat for remaining AINx...
- Uninit SAADC (nrf_drv_saadc_uninit)
- Sleep until next interval
Or do I need to rerun calibrate offset with each new AINx?