Hello, I'm trying to interface a DS1803 I2C digital pot without much luck :/
It looks like I'm just writing/reading back the buffer when I communicate with it.
I don't understand why, the address is properly set. And the I2C bus works, I have another device (PCF8574) on it.
If you guys have any idea....
These are the read/write function I'm using. As usual the read address is write+1.
As far as I can see from the datasheet the registers are none looping.
When I write a value and read back, the first is the register address instead of the first byte of data.
Void DS1803::setValue(uint8_t value)
{
Wire.beginTransmission(DPOT_ADDRESS_W);
Wire.send(DPOT_WIPERS); // Send the wiper address
Wire.send(value);
Wire.endTransmission();
}
uint8_t DS1803::getValue()
{
Wire.requestFrom(DPOT_ADDRESS_R, 2);
while (Wire.available()) {
Serial.println((uint8_t)Wire.receive(), DEC);
}
return 0;
}