Pages: [1] 2   Go Down
Author Topic: I2C interface with DAC6573- RESOLVED  (Read 829 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Code:
#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.


* IMG_2512.jpg (2370.31 KB, 3264x2448 - viewed 10 times.)
« Last Edit: January 21, 2013, 03:29:18 pm by ichris93 » Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12425
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 547
Posts: 45982
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


I set the value.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12425
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, stupid slip of the mind  smiley-red
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, stupid slip of the mind  smiley-red


No problem.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12425
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Lets try another "stupid "question smiley-wink

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

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Lets try another "stupid "question smiley-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 smiley-wink

Yes, they are all connected to GND.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Thanks guys.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12425
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)?

- http://www.gammon.com.au/forum/?id=10896 - search for scanner (~@ 80% of the page)
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)?

- http://www.gammon.com.au/forum/?id=10896 - search for scanner (~@ 80% of the page)


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. 
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12425
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

loose connections, happens all around the world smiley-wink
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

loose connections, happens all around the world smiley-wink

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

Dallas, TX
Offline Offline
Sr. Member
****
Karma: 10
Posts: 318
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Please publish a link to the library.
Logged

Pages: [1] 2   Go Up
Jump to: