PCF8591 using A/D and D/A

I am trying to use the PCF8591's D/A output and then read all four analogue inputs. However, I am reading back the D/A's output value as one of the inputs, the one for channel 0. I have tried auto increment and individual reads. Sometimes the input on channel 0 is being transferred to the analogue output. The data sheet says that the D/A's register is borrowed during A/D. Has any one got a sequence of I2C commands that would get the two converters working independent at the same time?

Based on your experience I'd expect that you already do so, but it's worth asking because you didn't specify yet: Are you setting bit 6 in every control byte sent to the device? My guess would be this setup:

byte get_value(byte input_no, byte da_value) {
  Wire.write(0x44 | input_no);
  Wire.requestFrom(DEVICE_ADDR, 2);
  if (Wire.available()) {
    byte oldres = Wire.read();
  if (Wire.available()) {
    byte val = Wire.read();
    return val;
  return 0;

This way you're ignoring the result code of the previous conversion run and just reading the current value of the analog input.

Are you setting bit 6 in every control byte sent to the device?

Yes, that is the output enable bit, thanks. If you don't set it then the output pin is high impedance.

In fact when outputting a ramp just to the D/A the ramp also appears on the analogue input A0. By grounding the A0 input or sending it to the supply you can actually stop the ramp and send the analogue output high or low. There seems to be some sort of coupling between the two. I have reluctantly orders another chip to check if this one is damaged in any way as I have had it a few years an it has been in several boards. Maybe the input multiplexer is shot?

Did I understand that correctly: Applying a voltage to A0 input changes the value of the Vout pin? It's not that you read just a wrong value for A0, you're actually changing the output value?

you're actually changing the output value?

Yes that is right. And the ramp is coming out of the A0 input as well.

Apart from that everything else works fine. Putting bit 6 of the control to zero allows me to read all the input channels independently and the value of the analogue output is controllable it is just this interaction when you are using both converters that has me a bit puzzled.

Well I got a new chip and that behaves just the same. So a piece of useful knowledge gained, when using the D/A on this chip the A/D channel 0 input can not be used. It doesn't say that in the data sheet, maybe it should.

Yes that's a bit of a gotcha. Worth a mention I would have thought.