This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

problems with differential SAADC reading of floating voltage, nRF52840

I'm trying to read a voltage from my power supply using the differential SAADC on my board to simulate the readings from a thermopile that I ordered so I can start calibrating/characterizing the ADC. The voltage output from the supply across V+ and V- is 0.060V. However the readings I'm getting from the SAADC read call is -8191 counts every time (-0.150V) which is the max input voltage. I find this very strange. I've verified that the supply is truly outputting 0.060V with my bench-top DMM. 

I've tried connecting V- to GND on the board and the negative probe on the ADC but this does not improve the results.
I've also tried connecting the supply GND to the board GND and that didn't yield good results either.
I also have tried connecting V+ to pin_p and V- to pin_n.
Another thing I've tried is enabling the pull-up and pull-down resistors on the pin_p and pin_n pins on the SAADC.

I'm certain that my driver usage is not incorrect as I have been able to make good measurements on single-ended readings and differential readings of other known sources. I'm a mechanical engineer so I feel there may be some gaps in my knowledge of reading floating voltages. Do you know what is happening here or how I might be able to get good measurements? What changes do I need to make to the circuit?

Info:
SDK version: 15.0.0
Dev board: PCA10056
Differential reading method: SAADC driver (nrfx_saadc.h)
Powering board from usb to computer.


SAADC configs:
.resolution = NRF_SAADC_RESOLUTION_14BIT,
.oversample = NRF_SAADC_OVERSAMPLE_128X,
.interrupt_priority = NRFX_SAADC_CONFIG_IRQ_PRIORITY,
.low_power_mode = true

Channel configs:
.resistor_p = NRF_SAADC_RESISTOR_DISABLED,
.resistor_n = NRF_SAADC_RESISTOR_DISABLED,
.gain = NRF_SAADC_GAIN4,
.reference = NRF_SAADC_REFERENCE_INTERNAL, // 0.6V
.acq_time = NRF_SAADC_ACQTIME_40US,
.mode = NRF_SAADC_MODE_DIFFERENTIAL,
.burst = NRF_SAADC_BURST_ENABLED,
.pin_p = NRF_SAADC_INPUT_AIN6, // P0.30
.pin_n = NRF_SAADC_INPUT_AIN1 // P0.03

Converting counts to voltage: (counts are uint16_t)
Input range = ±0.6 V / gain (4) = ±0.150V
V_read = counts * reference / gain * 2^-(resolution - 1) = counts * 18.31055 e-06

Parents
  • Nevermind. I found the source of my problem. I copied my channel configuration from another working differential channel, but changed the pins associated. Before testing to see if I could get correct readings from those pins I began making reads from my power supply. It turns out that the pins used (AIN6 and AIN1) were not making real reads and always return the max negative value. 

    When I connect my power-supply setup to the original channel, using AIN7 and AIN5, and connecting MCU GND to V- I can now get valid reads. The new problem now is why do AIN6 and AIN1 not perform reads correctly, despite having IDENTICAL settings to my AIN7 and AIN5 channel.

Reply
  • Nevermind. I found the source of my problem. I copied my channel configuration from another working differential channel, but changed the pins associated. Before testing to see if I could get correct readings from those pins I began making reads from my power supply. It turns out that the pins used (AIN6 and AIN1) were not making real reads and always return the max negative value. 

    When I connect my power-supply setup to the original channel, using AIN7 and AIN5, and connecting MCU GND to V- I can now get valid reads. The new problem now is why do AIN6 and AIN1 not perform reads correctly, despite having IDENTICAL settings to my AIN7 and AIN5 channel.

Children
No Data
Related