Start with the i2c_scanner : http://playground.arduino.cc/Main/I2cScanner
Use the address that is found by the i2c_scanner. If nothing is found, then there is a problem with the I2C bus (the hardware).
Sketch : The loop() might run too fast. Add "delay ( 500 ) ;" at the end of the loop().
Address 12 = 0x0C : probably okay, could be 12 or 13.
Usage of Wire library : okay.
Pointer byte for DAC A : okay.
Two shift register bytes for AD5305 : PD1 PD0 = 00: okay, /CLR /LDAC = 11: okay. D4..7 = 1 and D0..4 = 0: fine.
Thanks for you answer. I already have a delay(500) at the end, looks like I didn't copy it. Thanks for the I2cScanner, I didn't know about that! Will try asap.
If you want the DAC output to immediately change when you update it, set the /LDAC bit to low when you write the register data.
Do you have 4.7k pullups on SDA and SCL?
Which Arduino are you using? UNO, MEGA?
Koepel, I disagree,
/LDAC must be low (0). This device has a doubled buffered input. you can load all 4 DAC's and activate them at the same time. If you load the first three DAC's with /LDAC HIGH, then, load the LAST DAC with /LDAC low. All of the DAC's will immediately output the 'new' values at the same time.
Check page 18 of the data sheet. DOUBLE-BUFFERED INTERFACE
I am using an Arduino Nano, but also tried with an Arduino Mega 2560. I also tried supplying the DAC with 3,3V and 5V. Plus, I tried different pullups, ranging from 3.6k to 12k.
That doublebuffer concerns me. Does that mean I should have two write sequences? One for loading the inputregisters and one for setting them at the output?
EDIT: Thank you so much, that LDAC hint was the solution! I just understood that part in the datasheet completely wrong.