High-Precision-AD-DA-Board icon indicating copy to clipboard operation
High-Precision-AD-DA-Board copied to clipboard

Differential Mode does not work

Open userx14 opened this issue 5 years ago • 1 comments

I have tried to use the differential mode, but when using the library from an external file the variable ScanMode does lose it's value. Therefore ADS1256_SetMode(1) has no effect.

By moving the variable into the class I was able to fix the problem.

I will add a pull request, the issue is present in the python2 aswell as the python3 version.

userx14 avatar Oct 27 '19 17:10 userx14

I looked into this too. I shared a pull request update to ADS1256.py that seems to work and would appreciate your feedback! I made a SetMode class and set it at 0 for single input by default in ADS_init class.

Calling SetMode and setting it to anything other than 0 activates differential mode.

For what its worth, I found out that it's not necessary to do it anyway since the technical documents for ADS1256 from Texas Instruments claim that ADS1256 is always operating in differential mode and that comparing to AGND is the same as comparing to another pin. You can find the difference between (AIN_0-AGND)-(AIN_1-AGND) after getting pin values and come to the same answer.

But its nice to have it all happen automatically now!

jesgome avatar Apr 23 '22 00:04 jesgome