Update to this project
I received the new driver with the PCM board attached. I connected a non isolated 10vdc power supply with a standard 10K potentiometer and the motor functions well. So i belive i am back to the digital pot idea.
I got a few different options but most only allow for a 5vdc on the wiper side. I am using MCP45HV51-103E that avr_fred had suggested on page one since it will survive the 10v. This is my first experience with I²C communication and am not having any success in getting a response from the digi pot.
Chip data sheet: MCP45HVX1 Data sheet
My pin connections:
Pin (1) VL --> 5 v from arduino
Pin (2) SCL --> pin A5 from arduino with 4.7 K pull up resistor connected to 5v from arduino
Pin (3) A1 --> ground (used for changed chip address)
Pin (4) SDA --> pin A4 from arduino with 4.7 K pull up resistor connected to 5v from arduino
Pin (5) A0 --> ground (used for changed chip address)
Pin (6) WLAT --> ground
Pin (7) NC --> nothing
Pin (8) SHDN --> 5V from arduino
Pin (9) DGND --> ground from arduino
Pin(10) V- --> ground from 10v
Pin(11) PB0 --> Ground from 10v
Pin(12) PW0 --> To driver
Pin(13) PA0 --> 10v supply
Pin(14) V+ --> 10v supply
As a test of the digipot I reduced the 10v to 5.0 v and ran an LED from Pin(12) to a resistor to ground.
I used the I²C scanner and determined the address for the chip is 0x3C. and used this code just to get the digipot to do something.
#include<Wire.h>
// MCP45HV51 I2C address is 0x3C
#define Addr 0x3C
void setup()
{
// Initialise I2C communication as Master
Wire.begin();
// Initialise serial communication, set baud rate = 9600
Serial.begin(9600);
}
void loop()
{
//write 0 speed
// Start I2C transmission
Wire.beginTransmission(Addr);
// Select data register
Wire.write(0);
//print action on serial screen
Serial.print("Wite Resistance to 0 ");
// Stop I2C transmission
if(Wire.endTransmission() ==0){
Serial.println(" Success!");
}else{
Serial.println(" No");
}
delay(1500);
//write half speed
// Start I2C transmission
Wire.beginTransmission(Addr);
// Select data register
Wire.write(0x80);
//print action on serial screen
Serial.print("Wite Resistance to 128 ");
// Stop I2C transmission
if(Wire.endTransmission() ==0){
Serial.println(" Success!");
}else{
Serial.println(" No");
}
delay(1500);
//write full speed
// Start I2C transmission
Wire.beginTransmission(Addr);
// Select data register
Wire.write(0x3F);
//print action on serial screen
Serial.print("Wite Resistance to 255 ");
// Stop I2C transmission
if(Wire.endTransmission() ==0){
Serial.println(" Success!");
}else{
Serial.println(" No");
}
delay(1500);
}
Just as a test, this code should turn the LED off, then half bright, then full bright. but i get nothing on the light. The feedback on the Wire.endTransmission gives me a success on the "0" write for off, then "No" on the half and full writes.
Any ideas where i could be going wrong?