AnsweredAssumed Answered

AD7705 freeze value

Question asked by JosefKiefmann on Feb 15, 2017
Latest reply on Sep 21, 2017 by jcolao

Hello everyone,

can someone help with this issue, please?
I have some problem with AD7705 sigma-delta precision converter, after some readings of sampled value it freezes sampled value at decadic 2048 value and this value is still readed undependently on input voltage. If I use reset pin and doing calibration and initialization after reset or only doing calibration and initialization between reading measured samples, I think, it is closely correct (for reference input voltage for AIN1(+) and ground to AIN1(-) is value 65535 and ground connected to both pins return 0, input voltages between reference and ground returns appropriate value between 65535 and 0), but I think, that this access, what I actually do, to this device is not correct, because in datasheet is some schematic pictures, where the RESET pin is tied to positive supply voltage potencial. 

 

I looked at it and it freezes only when input voltage is between full-scale and zero-scale. If it on full-scale or zero-scale it sends correct values (65535 or 0), but when I change voltage, the value will change too, but after 5 values freeze on 2048, independently on previous value.

 

Voltage is filtered with 100nF, reference is used REF192 and also good filtered and crystal for modulator from AD7705 is 2.4576 MHz and two 27 pF ceramic condensators are connected to ground from crystal.

 

Actually I debug it on Intel Galileo 2, so here is some functions, what I wrote:

 

void setup() {
   pinMode(SCLK, OUTPUT);
   pinMode(nCS, OUTPUT);
   pinMode(nRESET, OUTPUT);
   pinMode(DIN, OUTPUT);
   pinMode(DOUT, INPUT);
   pinMode(nDRDY, INPUT);
   delay(2000);
   adc_init();
   delay(2000);
   while(digitalRead(nDRDY) == HIGH);
   Serial.begin(9600);
}

 

void loop() { 
   while(digitalRead(nDRDY) == HIGH);
   write8bRegister(0x38);
   while(digitalRead(nDRDY) == HIGH);
   ADC_LEVELS = read16bRegister();
   Serial.print("ADC = " );
   Serial.println(ADC_LEVELS);
   delay(100);
}

 

void write8bRegister(byte data){
   int i;
   byte mask = 0b10000000;

   digitalWrite(nCS,LOW);
   digitalWrite(SCLK,LOW);
   delay(1);
   for(i = 0; i < 8; i++){
      if(data & mask){
         digitalWrite(DIN,HIGH);
      }
      else{
         digitalWrite(DIN,LOW);
      }
      delay(1);
      digitalWrite(SCLK,HIGH);
      delay(1);
      mask = mask >> 1;
      if(i != 7) digitalWrite(SCLK,LOW);
      delay(1);
   }
   digitalWrite(nCS,HIGH);
   digitalWrite(DIN,LOW);
   delay(1);
}

 

word read16bRegister(void){
   word data = 0;
   int i;
   digitalWrite(SCLK, LOW);
   digitalWrite(nCS,LOW);
   delay(1);
   for(i = 0; i < 16; i++){
      digitalWrite(SCLK, LOW);
      delay(1);
      digitalWrite(SCLK, HIGH);
      delay(1);
      data |= digitalRead(DOUT);
      if(i != 15) data = data << 1;
      delay(1);
   }
   digitalWrite(nCS,HIGH);
   delay(1);
   return data;
}

 

void adc_init()
{
   digitalWrite(nRESET,LOW);
   digitalWrite(SCLK, HIGH);
   digitalWrite(nCS, HIGH);
   digitalWrite(nRESET, HIGH);
   adc_init2();
}

 

void adc_init2()
{
   write8bRegister(0b00100000); // Communication register write
   write8bRegister(0b00000101); // Clock register write
   write8bRegister(0b00010000); // Communication register write
   write8bRegister(0b01000100); // Setup register write
}

 

Before AD7705 I tried to measure with AD7715, but I got into the same state, repeatedly readed same value independently of input voltage.

 

I will be very happy, if someone tell me, where I do bugs in communication with these parts.

 

Thank everyone for response

 

Best regards

Outcomes