I'm trying to use the MAX 5401 as a gain potentiometer for a simple inverting op amp configuration. However, to test if the MAX 5401 is working, I attempted to wire it in series with an led and power source and was going to use a multimeter to read its resistance. I cannot get the digital potentiometer to work correctly and have little knowledge of SPI. I used the code below and it's not working correctly. Can someone please help me.
this program taken from arduino Example .
modified by By Mohannad Rawashdeh
This code used to control the digital potentiometer
MCP41100 connected to arduino Board
CS >>> D10
SCLK >> D13
DI >>> D11
PA0 TO VCC
PBO TO GND
PW0 TO led with resistor 100ohm .
byte address = 0x11;
int CS= 10;
pinMode (CS, OUTPUT);
// adjust high and low resistance of potentiometer
// adjust Highest Resistance .
// adjust wiper in the Mid point .
// adjust Lowest Resistance .
for (i = 0; i <= 255; i++)
for (i = 255; i >= 0; i--)
int digitalPotWrite(int value)