I want to control an MCP41HVX1 high voltage digital potentiometer in rheostat mode and tried to adapt the circuit and code from a tutorial I found that uses an MCP41010. I also have a MCP41010 and can get it to work, but for my current project I need higher voltages going through the resistor.
I'm stuck for days now, has anyone ever used an MCP41HVX1 and got it to work with an Arduino?
I included a sketch of my circuit as an attachment, the connections are (Arduino -> Digital Potentiometer): 10-> CS, 11-> SDI, 13-> SCK, 5V -> VL and V+, GND -> DGND and V-, Measurement of resistance between P0A and P0B and wiper resistance between P0W and P0A (I also tried different pin combinations for this)
Here's my code, which works with the MCP41010 but not with the MCP41HVX1:
#include <SPI.h>
byte address = 0x11;
int CS= 10;
void setup()
{
pinMode (CS, OUTPUT);
SPI.begin();
}
void loop()
{
digitalPotWrite(255, CS);
}
int digitalPotWrite(int value, char Port)
{
digitalWrite(Port, LOW);
SPI.transfer(address);
SPI.transfer(value);
digitalWrite(Port, HIGH);
}