Hello everyone I need to program digital potentiometer AD5260,
It's volatile memory and use SPI.
I connect the pin llike this :
Pin1 A +15Volt
Pin2 W Output
Pin3 – B- Ground
Pin4 VDD +15Volt
Pin5 SHDN +15Volt
Pin6 CLK Pin 13 Arduino
Pin7 SDI Pin 11 Arduino
Pin8 CS Pin 10 Arduino
Pin9 PR +15Volt
Pin10 GND Ground
Pin11 -VSS-Ground
Pin12 VL +5Volt
Pin13 -NC-No Connect
Pin14 -SDO-Pin 12 Arduino
And use the code below:
#include “SPI.h” // necessary library
int ss=10; // using digital pin 10 for SPI slave select
int del=200; // used for various delays
void setup()
{
pinMode(ss, OUTPUT); // for SS pin
SPI.begin(); // wake up the SPI bus.
SPI.setBitOrder(MSBFIRST); //ent MSB (most significant byte) first
}
void setValue(int value)
{
digitalWrite(ss, LOW);
SPI.transfer(0); // send command byte
SPI.transfer(value); // send value (0~255)
digitalWrite(ss, HIGH);
}
void loop()
{
for (int a=0; a<256; a++)
{
setValue(a);
delay(del);
}
for (int a=255; a>=0; —a)
{
setValue(a);
delay(del); }
}
But it won't work, the output on W still stuck on the midpoint, around 7,27 Volt.