Hello everyone,
This IC has me stumped. I have tried every combination I can come up with and there is nothing I can do to make it work.
Here's the schematic:
Here's the actual layout with the programming probe pads with the corresponding arduino terminals (CS=SS):
Here are the signals being sent for writting a 1 to pot 0 on falling edge of clock:
Thinking that it might be an issue with the -INDEP pin I have tried floating -INDEP, connecting it to ground and to +5V with no luck.
Thinking it might be the CPOL or CPHA I have tried all 4 modes of SPI_MODE0 to SPI_MODE3.
Tried also clock speeds from 10KHz to 1 MHz
Here's a sample of a simple program I've tried that works in a similar part from the same family:
#include <SPI.h>
void setup() {
// pin 10 is the slave select for the digital pot
pinMode( SS, OUTPUT); // set the slaveSelectPin as an output
// MISO input needs to be ;ulled up for the AD5142
pinMode( MISO, INPUT_PULLUP);
SPI.begin(); // initialize SPI
// set SPI speed to 500 kHertz, MSB, NORMAL LOW CLK and FALLING EDGE
SPI.beginTransaction (SPISettings (500000, MSBFIRST, SPI_MODE1));
}
void loop() {
digitalWrite(SS, LOW);// take the SS pin low to select the chip
SPI.transfer(0b00010000); // command 1 = set pot value, pot selected = 0
SPI.transfer(0b00000001); // pot value to set = 1
digitalWrite(SS, HIGH); // take the SS pin high to de-select the chip
}
Here's a link to the AD5142 Datasheet.
And here's the pinout:
The wiper starts in the middle of the pot range as expected by default from factory but I can't get it to respond in any way.
I made a circuit with only the IC and no luck, I even soldered small wires to each pin to the IC by itself to make sure the connections were correct but no luck.
I tried the code with another IC from the same family and it worked perfectly fine.
This code on SPI mode 0 works fine on an AD5204 that uses raising edge clock from the same family.
I know it'll be some tiny little detail I forgot or missed that will make it work but I'm stumped right now.
If you have any experience with this particular IC any help will be appreciated.
This IC has me stumped. I have tried every combination I can come up with and there is nothing I can do to make it work.
Here's the schematic:
Here's the actual layout with the programming probe pads with the corresponding arduino terminals (CS=SS):
Here are the signals being sent for writting a 1 to pot 0 on falling edge of clock:
Thinking that it might be an issue with the -INDEP pin I have tried floating -INDEP, connecting it to ground and to +5V with no luck.
Thinking it might be the CPOL or CPHA I have tried all 4 modes of SPI_MODE0 to SPI_MODE3.
Tried also clock speeds from 10KHz to 1 MHz
Here's a sample of a simple program I've tried that works in a similar part from the same family:
#include <SPI.h>
void setup() {
// pin 10 is the slave select for the digital pot
pinMode( SS, OUTPUT); // set the slaveSelectPin as an output
// MISO input needs to be ;ulled up for the AD5142
pinMode( MISO, INPUT_PULLUP);
SPI.begin(); // initialize SPI
// set SPI speed to 500 kHertz, MSB, NORMAL LOW CLK and FALLING EDGE
SPI.beginTransaction (SPISettings (500000, MSBFIRST, SPI_MODE1));
}
void loop() {
digitalWrite(SS, LOW);// take the SS pin low to select the chip
SPI.transfer(0b00010000); // command 1 = set pot value, pot selected = 0
SPI.transfer(0b00000001); // pot value to set = 1
digitalWrite(SS, HIGH); // take the SS pin high to de-select the chip
}
Here's a link to the AD5142 Datasheet.
And here's the pinout:
The wiper starts in the middle of the pot range as expected by default from factory but I can't get it to respond in any way.
I made a circuit with only the IC and no luck, I even soldered small wires to each pin to the IC by itself to make sure the connections were correct but no luck.
I tried the code with another IC from the same family and it worked perfectly fine.
This code on SPI mode 0 works fine on an AD5204 that uses raising edge clock from the same family.
I know it'll be some tiny little detail I forgot or missed that will make it work but I'm stumped right now.
If you have any experience with this particular IC any help will be appreciated.