SPI communication problem with ADS8681

Hello, There !

In one of my projects, I am trying to read ADC (ADS8681) data using SPI mode with Arduino Mega2560. I am able to get correct waveform across SPI pins while applying analog input of the range +- 10V in this case in first attempt (No Load to Full Load) it gives correct variation on LCD from 0 to 65,536 values. But when i remove the analog input (No Load) it shows some random values, instead of "0". SO can anyone suggest how to fix this problem? I would be rateful for any advice how to receive suitable data.
(connection to a single ADC, according to figure 71 (ADC data sheet p.37))

References which i used :
1] ADS8681 Datasheet : https://www.ti.com/product/ADS8681

2] Arduino SPI Library : SPI - Arduino Reference

3] TI Community : ADS8681: Problems to configure ADS 8681 to a Arduino MKW 1010 Wifi via SPI - Data converters forum - Data converters - TI E2E support forums

Here is the code

#include <SPI.h>
#include <LiquidCrystal.h>

#define SS 53    
#define SCK 52   
#define MOSI 51  // SDI
#define MISO 50  // SDO_x

uint16_t receivedVal16 = 0 ;
LiquidCrystal lcd (38,37,36,35,34,33);

void setup()
{
 lcd.begin(16,4); 
 SPI.begin();               
 SPI.setBitOrder(MSBFIRST); 
 SPI.setDataMode(SPI_MODE0);

 digitalWrite(SCK,OUTPUT);
 digitalWrite(MOSI,OUTPUT);
 digitalWrite(SS,OUTPUT);
 digitalWrite(MISO,INPUT);  
 
digitalWrite(SS, HIGH); //Write RANGE_SEL_REG
delay(10); 
digitalWrite(SS,LOW); 
SPI.transfer(0xD4);
SPI.transfer(0x14);
SPI.transfer(0x00);
SPI.transfer(0x01);

digitalWrite(SS, HIGH); //Write DATA_OUT_CNT_REG
delay(10); 
digitalWrite(SS,LOW);
SPI.transfer(0xD4);
SPI.transfer(0x10);
SPI.transfer(0x41);
SPI.transfer(0x00);
}

void loop() 
{
digitalWrite(SS, HIGH); //Write RANGE_SEL_REG
delay(10); 
digitalWrite(SS,LOW);
SPI.transfer(0xD4);
SPI.transfer(0x14);
SPI.transfer(0x00);
SPI.transfer(0x01);

digitalWrite(SS, HIGH); 
delay(10); 
digitalWrite(SS,LOW); 

receivedVal16 = SPI.transfer16(0x00);  
lcd.setCursor(0,1);
lcd.print(receivedVal16);

delay(100);
}

At the input of the ADC, you must have have something: 0V to 5V (if full scale is 5V); you should not leave it open/floating. Ground the input line of the ADC and check that the output is stable and very close to 0.

Let us follow the standard operating procedure of injecting zero voltage at the input of the ADC and then check the output for stable reading. Keeping the input terminal at floating state and then expecting the device to behave as one imagines is not an engineering practice.

Assume full scale 5V and unipolar operation.
Inject 0V volt at the input of ADC. Are you getting output close to 0x0000?
Inject 5 volt at the input of ADC. Are you getting output close to 0xFFFFF?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.