This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ads1118

Other Parts Discussed in Thread: ADS1118

hi

i use this code to communicate with an ADC which is in the same motherboard with a DAC, but i receive the value of voltage at the end until the variation of current value. please help

the code :

#include <Wire.h>
#include "ADS1118.h"
#include <SPI.h>

//int X1,X2;//
int value;
#define CS 10
void ds4432 ()
{
Wire.begin();
Wire.beginTransmission(0X48);//adress 0x90 décalé
//Wire.write(0X90);
Wire.write(0XF8);
Wire.write(0X8E);
Wire.endTransmission();

Wire.beginTransmission(0X48);
Wire.write(0XF9);
Wire.write(0X8E);
Wire.endTransmission();
}
ADS1118 ads1118(CS);
void setup()
{
Serial.begin(9600);
ds4432();
SPI.beginTransaction(SPISettings(14000000, MSBFIRST, SPI_MODE0));
ads1118.begin();
ads1118.setSampligRate(ads1118.RATE_8SPS);
ads1118.setInputSelected(ads1118.DIFF_2_3);
ads1118.setFullScaleRange(ads1118.FSR_2048);
ads1118.setContinuousMode();
ads1118.enablePullup();

}

void loop()
{
Serial.println(String(ads1118.getTemperature(),6)+" C");
Serial.println(String(ads1118.getMilliVolts(),10)+"mV");

}

  • Stevie,

    Can you be a bit more descriptive about your problem? I can't tell from your description if this is a coding issue, read issue, or circuit issue. Note that I'm not much of a coder, so I may be of  limited help with that. 

    There are several things that I ask for when people have problems like this. I want them to report back what raw data they get (ADC output code) and what they were expecting. I also want them to be able to ensure the configuration by reading back the configuration register to verify that it was written properly. Lastly, I strongly encourage them to show the digital communications from the device by using an oscilloscope or logic analyzer. We need to verify that the communications are working properly.

    Read through this post, and report back with some responses to my comments.

    Joseph Wu

  • hi

    what can i do if i want to see the data that the adc receive from the thermistance?

    thanks

  • Stevie,

    I've been busy with another project and I'm now just catching up with this. 

    As I mentioned in the previous post, I wanted to see the SPI communications from the device through an oscilloscope. If you post it back, we can directly read  the ADC communication, verifying the data.

    Joseph Wu