I2C interface with DAC6573- RESOLVED

Hi guys,

I am trying to communicate with a DAC6574 but I get the same I2C sequence no matter how I change the code. It looks like the attached image.

Do you need the code for it? This is the Arduino sketch

#include <Wire.h>
#include <DAC6573.h>
 
DAC6573 myDAC6573(DAC6573_DEFAULT_ADDRESS);

void setup() {
    Wire.begin(); //Start the I2C bus
    Serial.begin (9600);
}
 
void loop()
{
  byte channel=1;
  static word DAC;
  static int delta=10;
  Serial.print("DAC");
  Serial.println(DAC);
  delay(100);
  
  myDAC6573.DAC6573_SetChannel(DAC,channel);
  DAC=DAC+delta;
  if (DAC > 1020) {delta = -10;}
  if (DAC < 20) {delta = 10;}
  
}

I will post library too if it is needed.

Where do you read the value of the DAC?
Which statement does that?

If you include header files in the library header file, it is not necessary to include them in the library source file, too.

robtillaart:
Where do you read the value of the DAC?
Which statement does that?

I set the value.

Sorry, stupid slip of the mind :blush:

PaulS:
If you include header files in the library header file, it is not necessary to include them in the library source file, too.

That wouldn't create a problem though, right?

robtillaart:
Sorry, stupid slip of the mind :blush:

No problem.

Lets try another "stupid "question :wink:

How are the address lines of the chip connected?
Are they GND?

robtillaart:
Lets try another "stupid "question :wink:

How are the address lines of the chip connected?
Are they GND?

If "stupid" questions get me to a solution, it is no problem :wink:

Yes, they are all connected to GND.

I got it working by changing the A0 pin to 5V and then changing the address.

Thanks guys.

one question remains, could you test:

If you GND both address lines and you use the I2C scanner of nick Gammon, does it find the device?
similar for other address pin combinations (high/low)?

robtillaart:
one question remains, could you test:

If you GND both address lines and you use the I2C scanner of nick Gammon, does it find the device?
similar for other address pin combinations (high/low)?

Thank you for the source. Yes it does find it with all of them low and the same address, so I do not know why it didn't work with all of them low.

loose connections, happens all around the world :wink:

robtillaart:
loose connections, happens all around the world :wink:

No, because it doesn't work with that address. It finds it, but doesn't communicate properly.

Please publish a link to the library.

Did you notice the lib has a hard coded address - Wire.beginTransmission(DAC6573_ADDRESS_PIN13_HIGH_PIN14_LOW);

think that should be _address as param...

int _DAC[3]; is one element to small

There are more bugs in the lib => needs a make over..

Would you pls post a link of the DAC6573 library?