Problem with MCP4241


hey everybody

i'm trying use mcp4241 digital potentiometer , running issue haven't been able solve.  particular device 2 pots in 1 package (datasheet here)

i've been able p0 working without issue, can't p1 change @ all, stays @ 78 kohm measured wiper ground.

since can p0 work, connections should spi portion.  i've got p1b (pin 5) grounded, p1a (pin 7) vcc, same p0, p0b grounded , p0a vcc.

the relevant code follows:
in library header file:

const static uint8_t adr_wiper0 = b00000000;
const static uint8_t adr_wiper1 = b00010000;

const static uint8_t cmd_increment = b00000100;
const static uint8_t cmd_decrement = b00001000;

those commands start @ page 45.

in cpp file:

void mcp4241::volumeup() {
   uint8_t left = adr_wiper0 | cmd_increment;
   uint8_t right = adr_wiper1 | cmd_increment;
   spi.begintransaction(settings);
   digitalwrite(slave_select_pin, low);
   spi.transfer(right);
   spi.transfer(left);
   digitalwrite(slave_select_pin, high);
   spi.endtransaction();
}


according datasheet, page 48, "continuous commands" can send multiple commands , long they're valid they'll executed.  i've tried sending 1 command @ time, while "left" works, "right" doesn't.

i've got 2 pots, 104 (100k) , 103 (10k) both showing exact same problem.  i'm hoping there simple in command i've overlooked.

any appreciated,
eric

have tried separating commands prove p1 command ok? easy commenting out

spi.transfer(right);

line.

divide , conquer debugging.

______
rob


Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > Problem with MCP4241


arduino

Comments