AnsweredAssumed Answered

I2C Read - AD5667

Question asked by stylonurus on Aug 8, 2012
Latest reply on Aug 23, 2012 by stylonurus

For the last couple of days I have been attempting to get the read operation working for the AD5667. I am programming the operations in C using a few bit banging functions for start, stop, write, and read.

 

I got the write operation working perfectly and I have even tested the ACK from the device with positive results.

When I write, I send an address byte, command byte and then the 16bit DAC value. It works perfect. I can change it on the fly - no problem

 

But when I perform a read back operation all I get is 000000.

 

The read operation starts with a write of the address. The LSB of this byte is the R/W bit. So all  I do is set it to 1 otherwise the rest of the bits are the same as the write operation 0,0,0,1,1,A1,A2,R/W where A1, A2 = 0 for Vdd and R/W=1 for read operation. Then after the ACK from the AD5667, I read in 3 bytes, the command, and two data bytes. I have poured over the timing diagrams and believe I'm ok here.

 

Originally I was wondering what I was going to read since the operation does not specify the contents of which DAC (A or B)  would be returned. So perhaps what I am reading is the last command which was written. Is this true? Or perhaps I need to write a new command using different values for C2,C1,C0 in the command word which would shift the values so that the read operation could access them. Complete speculation on my part. And I doubt it since the data sheet does not mention this at all....

 

It might be obvious to you all that I'm not all that experienced with DAC's so i appreciate your patience and any helpful comments as well. I could surely post code here if anyone feels like givng me a code review.

 

Thanks 

Outcomes