[SOLVED] - Teensy 2++ and AD5293 DigiPot
Hi @all,
i'm currently working on a Project using the AD5293 DigiPot (http://www.analog.com/en/digital-to-analog-converters/digital-potentiometers/ad5293/products/product.html).
I connected the Teensy 2++ as followed:
Teensy 2++ <-> AD5293
B0 <-> SYNC (12)
B1 <-> SCLK (11)
B2 <-> DIN (10)
I'm using the following arduino code:
The Bit order is MSB first.
I really could not get this piece of code working and would appreciate any helpfull hinds!
BTW: SPI is working. I checked with AD5206 without any Problems.
Thx a lot.
Hi @all,
i'm currently working on a Project using the AD5293 DigiPot (http://www.analog.com/en/digital-to-analog-converters/digital-potentiometers/ad5293/products/product.html).
I connected the Teensy 2++ as followed:
Teensy 2++ <-> AD5293
B0 <-> SYNC (12)
B1 <-> SCLK (11)
B2 <-> DIN (10)
I'm using the following arduino code:
Code:
const byte AD_CS_PIN = 20;
// transfer 0x1802 to enable write to RDAC register
digitalWrite(AD_CS_PIN,LOW);
SPI.transfer(0x18);
SPI.transfer(0x02);
digitalWrite(AD_CS_PIN,HIGH);
// Transfer 0x500 to set to 1/4 full-scale
digitalWrite(AD_CS_PIN,LOW);
SPI.transfer(0x05); // 1/4 fullscale
SPI.transfer(0x00);
digitalWrite(AD_CS_PIN,HIGH);
// give some time
delay(2000);
// set to full-scale (1023)
digitalWrite(AD_CS_PIN,LOW);
SPI.transfer(0x07); // 1/4 fullscale
SPI.transfer(0xFF);
digitalWrite(AD_CS_PIN,HIGH);
The Bit order is MSB first.
I really could not get this piece of code working and would appreciate any helpfull hinds!
BTW: SPI is working. I checked with AD5206 without any Problems.
Thx a lot.
Last edited: