Communicate with MAX5816 DAC with I2C interface on arduino DUE

I'm new to using I2C devices and I'm currently working with a PCB that has one DAC and one ADC. For the ADC, I'm using the ADS1112 from Texas Instrument with the following code that seems to be working.

{
  Wire.begin(); // Wire communication begin
  Serial.begin(9600); // The baudrate of Serial monitor is set in 9600
  while (!Serial); // Waiting for Serial Monitor
}

int8_t x0,x1;
void loop()
{

  Wire.beginTransmission(0x48);
  Wire.write(10001100); //PGA modification
  Wire.endTransmission();
  
  Wire.requestFrom(0x48,2);
  if(2 <= Wire.available())
  {
  x0=Wire.read();
  x1=Wire.read();
  Serial.print("x0=");
  Serial.print(x0);
  Serial.print("\n");
  Serial.print("x1=");
  Serial.print(x1);
  Serial.print("\n");
  int16_t ADC_value=((int16_t) x0<<8)|x1;
//  int16_t ADC_value=((int16_t) x1>>8)|x0;
  Serial.print("ADC_value=");
  Serial.print (ADC_value);
  Serial.print("\n");
  Serial.println(ADC_value);
  delay(100);
  }
}

However, I'm having issues communicating with the DAC MAX5816 from Maxim Integrated Products. I'm using the following code to write to the device but it doesn't do anything and shuts down the board when uploaded.

void setup()
{
  Wire.begin(); // Wire communication begin
  Serial.begin(9600); // The baudrate of Serial monitor is set in 9600
  while (!Serial); // Waiting for Serial Monitor
}

void loop()
{
  //Write
  Wire.beginTransmission(0x0F);
  Wire.write(00010000);// Five most significant bits 00011 + LSBs 01 for Vdd -> A1 and GND -> A0 + R/W| bit to 1 for read mode
  Wire.endTransmission();
}

As the code for the ADC is working, I don't think it's a problem linked to pull up resistors or the devices addresses. I would also like to read from the DAC but don't know how to proceed. The final goal is simply to pass information from the ADC to the DAC and see if the conversion is good. Can someone help me with that please?

Note: I could not find libraries for the converters and changing components is difficult as it would mean I have to re-desing the whole PCB that has other components on it. (I can't upload the technical datasheets as I'm a new user)

I doubt that this line works as expected.

I might agree for the pull-ups but definitely not for the device address. As you try to access two chips with different addresses what makes you think that success with one chip implies the same for the other chip?

The comment on this line is wrong here, it probably should be located one line before explaining the address. As you failed to provide a link to the schematics of the board you're using we must assume you know the schematics and did the address calculation correctly.

As the MAX5816 expects 3 bytes for a standard protocol write operation you code cannot result in any defined reaction of the chip.

If you check the result code of the Wire.endTransmission() call I'm sure you get an error.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.