we are using nRF52832 ADC in differential mode. We have two channels connected, where other is presenting reference voltage 1,65V and other is +/-1,15V on top of that.
How should we configure the ADC?
Inputs are now configured as differential-N and differential-P (PSELP and PSELN).
Can we use oversampling in this mode? Or should we stick to SCAN mode? We have only one PSELP in use.
There seems to be much more noise when we are NOT using oversampling mode. But is our assumption correct that it should not be used when more than 1 input connected to ADC and in differential mode there are 2 inputs now?
You probably have some examples of configuration the ADC in differential mode? What should be taken into account?
We have connected op amp in differential mode to ADC input, impedance of source is 1kohm. --> shortest acquisition time in use.
Thank you in advance!
I suggest to start with the saadc example in the SDK:https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/nrf_dev_saadc_example
To change between single ended and differential you only need to use a difference macro when you init the channel(s):NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(PIN_P) vs.NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_DIFFERENTIAL(PIN_P, PIN_N).
In your case I suggest to setup 3 channels, the third channel is the reference voltage (this may also be differential). There are a some advantages by also sampling the reference voltage, you will reduce gain and offset errors in the saadc by directly comparing digital value of the analog input signal(s) vs. analog input reference voltage measurement.
You can enable all 3 channel with oversampling, burst, and scan. Then when you start sampling you will get an event when all 3 measurements are done.
I recommend to use 10us acquisition time or more due to these Errata's:http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.Rev2.errata/dita/errata/nRF52832/Rev2/latest/anomaly_832_74.html?cp=2_1_1_0_1_14 http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.Rev2.errata/dita/errata/nRF52832/Rev2/latest/anomaly_832_150.html?cp=2_1_1_0_1_40
Thanks Kenneth, this was good addition.
I will check the acquisition time!
We cannot use 3 channels, as we only have two signals.
And actually it is not pure differential signal, it is difference between two "floating" signals we are measuring with ADC.
This means that other is "fixed" 1.65V and other varies between 0,5V...2,8V. These two signals we should sample and report the difference.
Do you recommend to do it in sequence of two SE-samples?
If we do it in differential mode, does ADC internally report the difference of two signals as a result?
I think I understand, what voltage is VDD here?
VDD is 3,3V, regulated.
You have several options here, you may use VDD as reference and sample the two signals individually and calculate the difference, or sample the two signal as one differential signal. If you don't want to use VDD as reference, then you can use internal 0.6V as reference instead, but then you should enable 1/6 gain setting to make sure the measurement are below internal <0.6V reference.