Arduino Uno interface with MCP41010

Hir sir, I have interfaced Digital Potentiometer Part Number: MCP41010. I have attached the Code for your reference:

#include <SPI.h>

// Pins for SPI comms
#define DATA  11      // SPI Data pin number
#define CLK   13      // SPI Clock pin number
#define CS_DIGIPOT 9  // MCP41010 chip select - digital potentiometer.

void write_digipot(int val) {

   //  // take the CS pin low to select the chip:
  digitalWrite(CS_DIGIPOT,LOW);
  //  send in the address and value via SPI:
  SPI.transfer(B00010001);
  // write out the value
  SPI.transfer(val);
  // take the CS pin high to de-select the chip:
  digitalWrite(CS_DIGIPOT,HIGH);
  SPI.endTransaction();
}

void setup() {
   pinMode(CS_DIGIPOT,OUTPUT);

   SPI.begin(); // Set pins as outputs for SPI hardware.

   write_digipot(128); // Set MCP41010 to mid point.
}

void loop(void) {

}

The code is working. The part which is used is the 10k Digital Potentiometer. Here is the Reading for the SPI Data Sent:

if
Data --> 00 -- Resistance --> 0 ohms
Data --> 64 -- Resistance --> 2.2K ohms
Data --> 128 -- Resistance --> 4.3k ohms
Data --> 192 -- Resistance --> 6.5K ohms
Data --> 255 -- Resistance --> 8.6k Ohms

For testing I have used P-Dip Package of the Part : MCP41010 IC.
My question is, why the Resistance is not 10k ohms when i give the Data = 255? PA0 and PW0 pin is shorted. I am checking the Resistance in between PB0 and the PW0. What could be problem? Kindly let us know.

Datasheet for MCP41010:
MCP4201 datasheet.pdf (866.3 KB)

What could be problem?

It's 10K +/-20%.
So it can be anywhere between 8K and 12K.

1 Like

Hi Sir. In MCP41010, Shall we give the PA0 Pin to 8V and PB0 to Gnd and PW0 to Comparator input. VCC of the MCP41010 is 5V.
Can we feed the Digital Potentiometer PA0 Pin to 8V. As i need 0 to 8V adjustment in the comparator input. Kindly let us know.

Hi sir,

will this possible?

Screenshot from 2023-09-19 16-25-07

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.