AnsweredAssumed Answered

AD7747 CDC Setting Registers

Question asked by kimimaro on Jul 17, 2012
Latest reply on Jul 20, 2012 by kimimaro

Hi,

I am trying to make a continious single channel capacitance reader circuit. I am using PIC16F877 as host microcontroller and AD7747 capacitance to digital converter. I am having troubles with setting the registers. I can not set the resgisters as I want, or they are changed on their own.

 

 

Register NameRegister AddressDefault ValueAfter Reset ValueSet ValueAfter Setting Value
Cap Setup Register0x070x000x000xA00xA0
VT Setup Register0x080x000x03 *0x830x83
EXC Setup Register0x090x030x030x0F0xA1 *
Configuration Register0x0A0xA00xA00xA10x03 *
CAP DAC A Register0x0B0x000x000x000x00
CAP DAC B Register0x0C0x000x000x000x7F *

16 bits Cap Offset

Calibration Register

0x0D

0X0E

0x80

0x00

0x80

0xF8 *

0x80

0x00

0x80

0xF8 *

The register values with stars indicates unexpected results.

 

Here is the procedure of above table.

1- Reset

2- Read registers

3- wait 1 second

4- Set registers

5- Read registers

 

And the C code for reading registers from I2C. I read from I2C register values and store them at a byte array

 

          for(counter=0x00;counter<0x10;counter++){

 

          i2c_start();

          delay_us(20);

          i2c_write(0x90);

          delay_us(20);

          i2c_write(counter);

          delay_ms(10);

          i2c_start();

          delay_us(20);

          i2c_write(0x91);

          delay_us(20);

          register_values[counter] = i2c_read();

 

          }

 

And C code for setting a register (configuration register as an example);

 

void configuration_register(){

 

     i2c_start();

     delay_us(20);

     i2c_write(0x90);

     delay_us(20);

     i2c_write(0x0A);

     delay_us(20);

     i2c_write(0xA1);

     delay_us(20);

    

}

Outcomes