Closed djdlgl closed 1 year ago
Hi @djdlgl ,
I just tried it. I took the following small sketch:
#include <ADS1220_WE.h>
#include <SPI.h>
#define ADS1220_CS_PIN 7 // chip select pin
#define ADS1220_DRDY_PIN 6 // data ready pin
ADS1220_WE ads = ADS1220_WE(ADS1220_CS_PIN, ADS1220_DRDY_PIN);
void setup(){
Serial.begin(9600);
ads.init();
ads.bypassPGA(true);
}
void loop(){
float result = 0.0;
long longResult = 0;
ads.setCompareChannels(ADS1220_MUX_0_AVSS);
result = ads.getVoltage_mV();
Serial.print("AIN0 vs. AVSS [mV]: ");
Serial.println(result);
ads.setCompareChannels(ADS1220_MUX_2_AVSS);
result = ads.getVoltage_mV();
Serial.print("AIN2 vs. AVSS [mV]: ");
Serial.println(result);
Serial.println();
delay(2000);
}
When I attach AIN0 and AIN2 to GND I get the following output:
When I attach both to ~1 Volt, then I get:
The results are more or less as expected, i.e. I can't reproduce the issue you are facing.
If you apply exactly the same sketch like the one above, do you get results that make sense? If no, then something might be wrong with your circuit or your module. If yes, then check the code you had used when you got the strange results.
Good luck!
Hi @djdlgl, have you tried my sketch? Do you still have the problem?
Hi @djdlgl , any news? If I don't hear anything from you I will close the the issue.
Since there was no further feedback I close the issue.
Hello, I am having a problem with AIN2 pin.
The other pins are well working like if I connect AIN0 to GND, it shows few miliV only which is very close to GND. However, for AIN2 pin, it shows about 500 mV. Why does it happen? Even, I am not using with IDAC function.
And according to your tutorial, I checked that your AIN2 (microVolt) is about 800 mV.
Thank you for reading.