ADC icon indicating copy to clipboard operation
ADC copied to clipboard

Differential gain settings not working correctly

Open EclipseBoom opened this issue 5 years ago • 1 comments

I was trying out the differential conversion options with various gain settings and I noticed that x8 and x16 settings seems to not be correct. I did a little sketch to read the same signal at 1,2,4,8,16,32x gain settings and these are the results (Teensy 3.2, A10,A11 inputs, 16-bit resolution)

1088, 2102, 3764, 7278, 9730, 17340 different level 502, 944, 1716, 3118, 4402, 8102

The signal is from a wheatstone bridge with a 3.3V supply so the common mode voltage is about 1.65V

// Differential reads adc->enablePGA(1); value = adc->adc0->analogReadDifferential(A10, A11); // read a new value, will return ADC_ERROR_VALUE if the comparison is false. Serial.print(value); Serial.print(", "); adc->enablePGA(2); value = adc->adc0->analogReadDifferential(A10, A11); // read a new value, will return ADC_ERROR_VALUE if the comparison is false. Serial.print(value); Serial.print(", "); adc->enablePGA(4); value = adc->adc0->analogReadDifferential(A10, A11); // read a new value, will return ADC_ERROR_VALUE if the comparison is false. Serial.print(value); Serial.print(", "); adc->enablePGA(8); value = adc->adc0->analogReadDifferential(A10, A11); // read a new value, will return ADC_ERROR_VALUE if the comparison is false. Serial.print(value); Serial.print(", "); adc->enablePGA(16); value = adc->adc0->analogReadDifferential(A10, A11); // read a new value, will return ADC_ERROR_VALUE if the comparison is false. Serial.print(value); Serial.print(", "); adc->enablePGA(32); value = adc->adc0->analogReadDifferential(A10, A11); // read a new value, will return ADC_ERROR_VALUE if the comparison is false. Serial.print(value); Serial.println();

EclipseBoom avatar May 22 '20 13:05 EclipseBoom

Yeah that seems off. Maybe I'll have time to look into in during the weekend, thanks for reporting it.

pedvide avatar May 27 '20 18:05 pedvide