system
January 19, 2013, 6:21am
1
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?
system
January 20, 2013, 9:12pm
3
If you include header files in the library header file, it is not necessary to include them in the library source file, too.
Sorry, stupid slip of the mind
system
January 21, 2013, 6:51pm
6
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?
Lets try another "stupid "question
How are the address lines of the chip connected?
Are they GND?
system
January 21, 2013, 7:16pm
9
robtillaart:
Lets try another "stupid "question
How are the address lines of the chip connected?
Are they GND?
If "stupid" questions get me to a solution, it is no problem
Yes, they are all connected to GND.
system
January 21, 2013, 8:30pm
10
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)?
system
January 22, 2013, 12:19am
12
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
system
January 22, 2013, 5:25pm
14
robtillaart:
loose connections, happens all around the world
No, because it doesn't work with that address. It finds it, but doesn't communicate properly.
PapaG
January 22, 2013, 5:48pm
15
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?