I am new to using arduino and i need to make a project that provides a variable load that can be controlled using the Software. I tried using digital pots and they worked great. But i needed to have very low tolerance so that is how i came across the AD5292. But as i began trying to work with them i realizes that the AD5292 does not have a CS pin which is what i used for the last Digitalpot. I was wondering how i can work around this. Any help would be greatly appreciated.
When SYNC goes low, it enables the shift register and data is transferred in on the falling edges of the following clocks. The selected register is updated on the rising edge of SYNC.
it looks like this is the equivalent of /CS on the SPI bus.
The datasheet claims SPI compatibility, it would be odd for there to not be something like /CS.
Thank you for responding. I am aware of the current capabilities i plan to use the digital pot values of for 4K and above so it is below the max current of 3mA. Thanks again for responding
I would like to thank you for your help. After reading you post and looking at the datasheet i see that you are correct. I am now using SYNC. However i am still unable to get the wiper to move.
Here is a list of the connections from the ad5292 digital pot to the arduino and the power supply:
digitalWrite(SYNCPin, LOW);
// Send the command and data
SPI.transfer(B01000000); // Write data to the RDAC register
SPI.transfer(highByte(resistanceValue)); // Send the high byte of the 10-bit resistance value
SPI.transfer(lowByte(resistanceValue)); // Send the low byte
digitalWrite(SYNCPin, HIGH);
// Print debugging information
Serial.print("Set resistance value to: ");
Serial.println(resistanceValue);
delay(10); // Delay for 10 milliseconds (adjust as needed)
}
}
If anyone can see a problem or mistake with my code or wiring i would be very gratefully.
FWIW hand drawn is often easiest and fastest, and can be entirely adequate.
I like schematic drawing programs, but just as word processors do not teach you how to write, CAD doesn't teach you how to draw a schematic.
And like reading makes you a better writer, looking at schematics will help you now how they should be drawn.
You can go a long time with pencil and paper, and nothing you learn doing it that way will be wasted when you step up or into schematic drawings tools.
The first important thing is to show every component, with clear markings on the pins, and all the connections between them.
In this area of work, particular attention should be paid to the sources of power and how power get to the parts that need it, like servos and sensors and stuff.
I am fairly new to working with Arduino and would appreciate it if someone could help me with this project. I am working with an AD5292 digital potentiometer, I aim to be able to change the wiper position using SPI communication the Arduino. When the AD5292 is wired and powered the wiper resistance is on 20K but when i run the Arduino code and try and change the wiper resistance nothing changes. Here is the code i am using
#include <SPI.h>
// Define the AD5292 control pins
const int CS_PIN = 10; // Chip select (CS) pin
void setWiperPosition(uint16_t position) {
// Command 1 for writing data to RDAC
uint8_t command = 0b00000001;
// The data word to set the wiper position to step 100
uint16_t dataWord = position & 0x03FF; // Make sure it's within 10 bits
// Start communication
digitalWrite(CS_PIN, LOW);
// Send the command
SPI.transfer(command);
// Send the data word
SPI.transfer(highByte(dataWord));
SPI.transfer(lowByte(dataWord));
// End communication
digitalWrite(CS_PIN, HIGH);
}
void setup() {
// Initialize SPI communication
SPI.begin();
SPI.setDataMode(SPI_MODE0); // Set data mode to Mode 0
SPI.setClockDivider(SPI_CLOCK_DIV16); // You may need to adjust the clock speed
// Set the Slave Select (SS) pin as an output
pinMode(CS_PIN, OUTPUT);
}
void loop() {
// Set the wiper position to step 100
setWiperPosition(100);
delay(1000); // Delay for testing (you can adjust this)
}
The datasheet for ad5292 page 23 talk about sending a 16 bit message which contains the command and the value you want to send. I believe my code preforms this but again my wiper is not changing.
Thanks for responding. I am use to working with GitHub but it seems that the code used in that library is for I2C communication which does not help because i am using SPI.