Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differential gain settings not working correctly #59

Open
EclipseBoom opened this issue May 22, 2020 · 1 comment
Open

Differential gain settings not working correctly #59

EclipseBoom opened this issue May 22, 2020 · 1 comment
Labels

Comments

@EclipseBoom
Copy link

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();

@pedvide pedvide added the bug label May 27, 2020
@pedvide
Copy link
Owner

pedvide commented May 27, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants