Help with I2C on microchip MCP3421 ADC

Hi,

I was not able to get much help from old posts on this topic so I thought I would start a new one in hopes that someone would please check my work and help me get this going.

So i’m trying to interface a I2C ADC to the arduino, this is my first experience with I2C. My code seems to work through the sending the configuration bit and the first endtransmition. however when it comes time to read the registers on the ADC nothing happens. The hiccup comes when i try to poll wire.available() for the 4 bytes needed. a serial print outputs a square continuously. I take this to mean that the communication is not happening and so that register is empty.

the spec sheet for the device can be found here http://ww1.microchip.com/downloads/en/DeviceDoc/22003e.pdf/url]

here is my code… any suggestions will be greatly appreciated.

/******************************************************************************

  • Arduino analog input 5 - I2C SCL
  • Arduino analog input 4 - I2C SDA

******************************************************************************/

#include <Wire.h>

// I2C device address is 1011 A2(0) A1(0) A0(0)or 1011000
void setup()
{
Serial.begin(9600);
}

int config;
int A8_data;
int B8_data;
int C8_data;

void loop()
{
// Setup device and initiate one shot conversion

// I2C device address is 1011 A2(0) A1(0) A0(0)or 1011000
Wire.begin(0x68);
// Datasheet indicates that a config bit of 10001100 for
// single shot conversion and 18 bit resolution
Wire.send(0x8C);
Wire.endTransmission();
// delay for the ADC to make conversion
delay(1000);
// Connect to device and request four bytes (three data one config)
Wire.begin(0x68);
Wire.requestFrom(0x68, 4);
// wait until there is data to read
while(Wire.available()<4)
{ ; }
// here is where program does not perform
// serial.print(Wire.Avalible()) inside while loop
// returns only a square box, this seems to indicate
// that the chip is not returning any data

//recive data
A8_data = Wire.receive();
B8_data = Wire.receive();
C8_data = Wire.receive();
config = Wire.receive();

Serial.print(“A8_data:”);
Serial.println(A8_data);

Serial.print(“B8_data:”);
Serial.println(B8_data);

Serial.print(“C8_data:”);
Serial.println(C8_data);

Serial.print(“config:”);
Serial.println(config);

Wire.endTransmission();

delay (10000);
}