Problem with interfacing MCP4651-502E digital potentiometer using I2C

Hello everyone,

i am using two MCP4651 dual digital potentiometers, i also attached PCB schematic, which i want to control from arduino uno thru I2C. Here’s datasheet for MCP4651, so you don’t have to look for it: http://www.farnell.com/datasheets/1789212.pdf

I am trying to write my value into the wiper 1 register like on page 49 of datasheet. But every command i try, i get not acknowledged. I also attached screenshot of oscilloscope.

Here’s my code:

#include <Wire.h>

void setup() 
{
  Wire.begin();
}

void loop()
{
  Wire.beginTransmission(40);
  Wire.write(0b10010000);
  Wire.write(0b10000000); 
  Wire.endTransmission(40);
  delayMicroseconds(500);
}

The I2C protocol clearly works, or i would not get acknowledged address and i tried both potentiometers, both wipers, writing, incrementing and decrementing. Not a single success. If anyone knows what am i doing wrong, i would be grateful.

Here's the screenshot, it was too big for upload https://www.dropbox.com/s/18l01gbka9da5mp/osci.jpg?dl=0

Address 40 means all A0,A1,A4 grounded. pullup_resistors missing ?? scope shows 3.6V Should be closer to 5V ?

Move 4 code_lines (transmission) to setup(). (Why repeat write unaltered data?)

How do you know that the viper isn't set correctly?

Yep, addresses are 40 and 41. There are 2k7 pullup resistors, it can operate between 1.8V and 5.5V so i chose 3.3V. I have it in loop cos i was incrementing the wiper before, forgot to move it in setup after.

Well for MCP46XX you need to send 3 bytes : address, command and value, and you can see in the scope that address was sent OK, it acknowledged, but after the command was sent, it did not acknowledge. Also i was measuring that wiper, and it was constant.