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.

ADS8665: ADS8665 interface issue

Part Number: ADS8665

HI i am trying to interface ADS8665 with arduino uno board but i am getting adc value constant which is mention in below picture

and i follow this link 

https://electronics.stackexchange.com/questions/503063/interfacing-ad7321-adc-with-arduino-using-spi

output

my code :

#include <SPI.h>
#define CS_PIN 7 //Pin 10 defined as the CS Pin.                  //AD7321  12 bit
void setup()
{
  Serial.begin(115200); //Initalise port to print in serial terminal
  pinMode(CS_PIN,OUTPUT); //Pin 10 as CS
  digitalWrite(CS_PIN,HIGH);
  SPI.begin();  //Intialise SPI PORT
  SPI.setBitOrder(MSBFIRST);
  SPI.setClockDivider(SPI_CLOCK_DIV128);
  initialise();
}

void loop()
{
  uint16_t adcOut=0;
  float value=0.0;
  initialise();
  adcOut = readADC(0);
  adcOut = (adcOut<<3);          // Bitshift to take last 13bits
  value = (adcOut>>3);
  Serial.println(value);
  //delay(0.5); //wait a second
  delayMicroseconds(0.5); //Delay
}

uint16_t readADC(int channel)
{
 
  uint16_t output=0;
  digitalWrite(CS_PIN,LOW);
  byte msb=0;
  byte lsb=0;
  msb = SPI.transfer(0x00);
  lsb = SPI.transfer(0x00);
  digitalWrite(CS_PIN,HIGH); // Deselect slave by pulling CS_PIN HIGH.
  output = (msb << 4 | lsb); //Combine MSB with LSB to form the 16 Bit Analog read  Value.
  // Serial.println(output);
  return output; //Output Value
}

void initialise()
{
  digitalWrite(CS_PIN, LOW); //Select the connected chip by pulling CS_PIN LOW.
  SPI.transfer(0b00000000);  //Defines range register -> | Write (1) | 0 | Register Select (1) | Vin0A | Vin0B | 0 | 0 | Vin1A |
  SPI.transfer(0b00000000);  // | Vin1B | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
  digitalWrite(CS_PIN, HIGH);
  delayMicroseconds(1);
  digitalWrite(CS_PIN, LOW);
  SPI.transfer(0b00000000);  //Defines control register -> | Write (1) | 0 | Register Select (0) | 0 | 0 | ADD0 | Mode1 | Mode0 |
  SPI.transfer(0b00001011);  // | PM1 | PM0 | Coding | Ref | Seq1 | Seq2 | 0 | 0 |
  digitalWrite(CS_PIN, HIGH);
  delayMicroseconds(1);
}

block diagram connection

can you guide me how to interface with mcu .

BR 

DG

  • Hi Margub,

    Welcome to our e2e forum!  The link you provided above has nothing to do with our ADS8665.  Can you please supplement the code snippet above with a capture of your /CS, SDI, SCLK, SDO lines using either a logic analyzer or o'scope?