AnsweredAssumed Answered

How to make connection between AD5933EBZ and Arduino UNO by I2C interface?

Question asked by glavryba on Aug 3, 2016
Latest reply on Aug 7, 2016 by mcee

Can't make connection between AD5933EBZ and Arduino UNO by I2C interface. My scheme of connection is on image.

 

Can't get any reaction between them.

 

Code is looks like this:

int AD5933::getByte(byte address, byte *value) {

   // Request to read a byte using the address pointer register

   Wire.beginTransmission(AD5933_ADDR);

   Wire.write(ADDR_PTR);

   Wire.write(address);
   // Ensure transmission worked

   if (byte res = Wire.endTransmission() != I2C_RESULT_SUCCESS) {

       *value = res;

       return false;

   }
   // Read the byte from the written address

   Wire.requestFrom(AD5933_ADDR, 1);

   if (Wire.available()) {

       *value = Wire.read();

       return true;

   } else {

       *value = 0;

       return false;

   }

}
bool AD5933::sendByte(byte address, byte value) {

   // Send byte to address

   Wire.beginTransmission(AD5933_ADDR);

   Wire.write(address);

   Wire.write(value);
   // Check that transmission completed successfully

   if (byte res = Wire.endTransmission() != I2C_RESULT_SUCCESS) {

       return false;

   } else {

       return true;

   }

}
bool AD5933::reset() {

   // Get the current value of the control register

   byte val;

   if (!getByte(CTRL_REG2, &val))

       return false;
   // Set bit D4 for restart

   val |= CTRL_RESET;
   // Send byte back

   return sendByte(CTRL_REG2, val);

}

Outcomes