Hello,
I'm recently trying to connect arduino nano board to a Texas Instruments 18 bit ADC. ADS8699 datasheet I'm using standard SPI protocol in mode 0. This ADC requires some external parts in order to work so I have created custom board, which schematic could be found there. For communication with arduino I use pins SCLK, CS, SDI and SDO-0 (SPI protocol mode 0). After completing all conections ADC behaves in strange way. First it seems that I cannot acccess ADC registers, ADC always return conversion result which is number between 131072 and 262144 which is correct but returned value jumps from one value to other much greater value without all intermediate steps as I change input voltage. Here you can find chart representing ADC redouts while I'm changing input voltage in 0-12 V range and back redoutCurve. I do not understand why measured voltage value changes so abruptly. Below please find code I use to red ADC conversion results:
long measureVoltage(){
uint8_t val1, val2, val3 = 0;
long m = 0;
long tmpM;
long _time = 0;
SPI.beginTransaction (SPISettings(100000, MSBFIRST, SPI_MODE0););
digitalWrite(CS_PIN,LOW);
delayMicroseconds(5);
digitalWrite(CS_PIN,HIGH);
delayMicroseconds(10);
digitalWrite(CS_PIN,LOW);
val1 = SPI.transfer(0x00);
val2 = SPI.transfer(0x00);
val3 = SPI.transfer(0x00);
digitalWrite(CS_PIN,HIGH);
SPI.endTransaction();
m = 0;
tmpM = 0;
m += val1;
m = m<<10;
tmpM+=val2;
tmpM = tmpM<<2;
val3 = val3>>6;
tmpM += val3;
m += tmpM;
return m;
}
Thank you for your help.