I'm working on interfacing mcp4728. Everything seems working fine except writing programmable slave address. Based on the datasheet, I need LDAC pin low right after 8th bit before ACK. http://ww1.microchip.com/downloads/en/DeviceDoc/22187E.pdf
I dig around wire and twi library. It seems TWSR only return status after ACK or NACK is received. Is there a way to check clock line itself or way to check when TWI send all 8 bit ?
I believe you can wait as long as you wish to pulse LDAC to low. If you wish to synchronize all four outputs, then it looks like you can write them all and pulse LDAC low any time prior to starting the next "set" or outputs.
Thanks for reply. As figure 5-11 note 2.b, timing of LDAC seem to be critical. It seems LDAC pulse has to happen low clock of 8th bit. I tried LDAC pulse after 2nd byte, it does not work. I checked timing of the pulse using another arduino, it happened after receive ACK.