Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Setup of Analog Devices digital potentiometer AD5292?

Status
Not open for further replies.

389iaB4Yg6Xn

Junior Member level 1
Junior Member level 1
Joined
Jun 26, 2008
Messages
17
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,396
Has anybody had any experience using Analog Devices AD5292 digital potentiometer with SPI. I must say that it's datasheet is substandard and doesn't clearly explain this setup (having read hundreds of datasheets myself in my carrer).
I would need info about correct initialization words over SPI to change it's resistance.
Any experience with similar Analog Devices digital potentiometer would help as well.
 

I haven't used this particular device, but having read through the datasheet I can only assume that your problems are being caused by the real device having some undocumented behaviour causing it not to work in accordance with the datasheet. I assume this because I can't see anything wrong with the datasheet - pages 18 to 20 seem to be a pretty comprehensive and clearly written explanation of how to use the serial interface.

I've also read plenty of datasheets in my career, and trust me, if you think this one is in any way substandard then you've been incredibly lucky not to have come across any of the genuinely poor/misleading/completely inaccurate datasheets out there.
 
ChrisC thank you for your effort. I didn't want anyone who hasn't used any chips of the same family to try and help me. I don't think one should make so much effort in answering such specific question to some random guy. But to someone who has experiences, this usually isn't an effort - just remembering from past.
I agree I saw worst datasheets (not much) and this one isn't so very bad. But it doesn't provide hands on start up guide, which is always welcome (same experience with another AD chip, which I also had great difficulty starting up). It also isn't very intuitive.
Anyway...if only AD support were better/useful/responsive. I should stop ranting about AD now.
In any case from my understanding of datasheet I should send 0x1802 to enable SPI to RDAC writing and the actually write to RDAC, like 0x0500. I am unsure, if I should clock out SDO response after each of these commands or not (very unclear) and if I should do anything else.
 

389iaB4Yg6Xn said:
In any case from my understanding of datasheet I should send 0x1802 to enable SPI to RDAC writing and the actually write to RDAC, like 0x0500. I am unsure, if I should clock out SDO response after each of these commands or not (very unclear) and if I should do anything else.

If the datasheet hasn't left anything out, then you're understanding it just fine - after power-up you send the 0x1802 command to enable RDAC updates, and then whenever you want to change the wiper position you just need to send (0x0400 | wiper pos).

As for clocking out the SDO response, this is done automatically by the device each time you write to the device, that's how the SPI interface operates. Each time you send a command, you automatically receive the response to the previous command (note in table 10 how the SDO responses lag the DIN writes by one step), so the only time you need to explicitly "clock out" the data from the slave device is if you've finished writing to the device and you need to get the response to the last command you sent. In order to get that you'd then need to write something to the device that doesn't alter its configuration, and this device provides the NOP command for this purpose.
 

I have been trying using this setup in a countless variations for several days now, with no success. It's frustrating, because in same application I'm using same SPI settings for another AD chip, but with different SS. So I suspect, there is some undocumented issue here.
So far I haven't been able to change the resistance.
 

AD9833 signal generator. It's SPI specs is the same as AD5292 (except reading is done simultaneously with writing).
 

Have you tried lifting the AD9833 and just having the AD5292 connected to the micro? Although I can't see anything in the 9833 datasheet which suggests it doesn't play nice with other SPI devices, experience has shown me that if you're trying to debug SPI problems with a single slave device in a multi-slave setup, the first thing to do is physically disconnect all the other slaves from the SPI wires...

Whilst the 5292 datasheet suggests it's capable of running at slightly higher SPI clock frequencies than the 9833, it also shows slightly longer setup and hold times for various other aspects of the interface timing - e.g. 9833 minimum data hold time is 3ns, 5292 minimum is 5ns... If you're running your SPI interface close to the limits for the 9833, you may be pushing it just over the edge for the 5292, so I'd be looking to test the 5292 with the SPI interface running as slowly as your master can manage.

Have you verified that the RESET pin on the 5292 is being held high,with no glitches (the datasheet indicates it only needs to go low for 20ns to cause a reset), once you've started to use the device?

Of course, I'm assuming you've already tried swapping the existing 5292 for a new one, just to rule out a hardware failure? When you first power up the board with the existing 5292, is it setting itself up with the correct default resistance?


As an aside, note that the AD9833 doesn't output any data (it doesn't have a data out pin), so you're not reading anything from it, simultaneously or otherwise.
 
Well, 9833 and 5292 have each it's own Slave Select (Sync) input, connected to the micro. I also tried commenting any communtication with 9833 during 5292 debugging.
SPI timing I tried varying, but I'm keeping it in the range of 100 us clock period, which should be foolprof.
RESET is definetly high after power on (I have also tried keeping it low for 1 sec and then high and after 1 sec beginning with SPI write).
I tested different SPI setups on 3 different boards. At power up, resistance is at 50%.
No I'm not waiting on any output from 9833.
Thank you for the help anyway - you shouldn't bother, specially if your'e not using the device now or in future.
Once I figure out the problem, I'll post solution here.
BTW I found a German forum, where there are currently 3 of us having same problem of setting 5292 succesfully.
Hope AD responds soon.
 

The problem was, that idle state for CLK signal is supposed to be low and not high. This is exactly opposite as with other AD chip I use AD9833, which is crazy in my opinion. This other chip requires positive idle state of CLK. Therefore I have to change SPI settings when I switch communication from 1 AD chip to another.
Of course no such thing was mentioned or indicated nowhere in datasheet...
Thanks for the help anyway...
 

I understand you finally solved the problem.
Do you mean the clock has to be low when SYNC goes low, or what? I ask because, like you, I can't get the potentiometer RDAC to respond to clocks set up according to the data sheet. I have an AD5292 demo board which works, and I have even tried to copy exactly their waveforms; but still get no result! (On the demo board SYNC goes low while SCLK is high.)
 

PeterWFry said:
I understand you finally solved the problem.
Do you mean the clock has to be low when SYNC goes low, or what? I ask because, like you, I can't get the potentiometer RDAC to respond to clocks set up according to the data sheet. I have an AD5292 demo board which works, and I have even tried to copy exactly their waveforms; but still get no result! (On the demo board SYNC goes low while SCLK is high.)

it's not very fresh any more...but searching on other forums, where I posted solution to MY problem (your's might not be the same), I was able to solve it, by changing SCLK to low, when idle.
oscillogram before solution:
https://www4.slikomat.com/09/1217/cmg-not-wo.jpg
oscillogram after solution:
https://www4.slikomat.com/09/1217/fv8-workin.jpg

report if this did the trick. AD support sucks...
 

hello, I met the same problem, and I also change the idle sclk to low, but the digital pot still could not work. Do you have any other suggestion for me? many thanks
 

Has anybody had any experience using Analog Devices AD5292 digital potentiometer with SPI. I must say that it's datasheet is substandard and doesn't clearly explain this setup (having read hundreds of datasheets myself in my carrer).
I would need info about correct initialization words over SPI to change it's resistance.
Any experience with similar Analog Devices digital potentiometer would help as well.

I experienced the same problem, and apparently the chip never was able to update the wiper position.
Reading back data by read command, after write wiper was ok, but still no changes.

All was apparently correct, after I spent about 6 hours to change all what possible and become frustrating I have read again carefully the datasheet....

The solution was quite simple!



First the correct mode of SPI needs to be actuated to follow datasheet

(for instance must be specified that the spi interface accept several modes and not so critical):

1) CLOCK MUST BE ->LOW IDLE

2) CLOCK SELECT ->FALLING EDGE

3) BE SURE THAT /SYNC PIN MUST BE DRIVEN LOW BEFORE CLOCK STARTS (FROM LOW IDLE TO HIGH)



Now the simple one :



4) READ CAREFULLY TABLE 12 of datasheet that is page 23 if Rev.A document



The story is : SEND FIRST HEX 1803 to enable wiper position

Then if want update wiper : SEND COMMAND 1 (TABLE 11)

Then if want verify : SEND COMMAND 7



Conclusion

Before wiper and / or 20TP memory may be updated HEX 1803 must be sended to DAC register, then this DAC works perfectly!.

*PS (I Hope must be helpful)



Aldo Ferraro - CONSULTANT

ELDEV ELETTRONICA

MILANO
 

I experienced the same problem, and apparently the chip never was able to update the wiper position.
Reading back data by read command, after write wiper was ok, but still no changes.

All was apparently correct, after I spent about 6 hours to change all what possible and become frustrating I have read again carefully the datasheet....

The solution was quite simple!



First the correct mode of SPI needs to be actuated to follow datasheet

(for instance must be specified that the spi interface accept several modes and not so critical):

1) CLOCK MUST BE ->LOW IDLE

2) CLOCK SELECT ->FALLING EDGE

3) BE SURE THAT /SYNC PIN MUST BE DRIVEN LOW BEFORE CLOCK STARTS (FROM LOW IDLE TO HIGH)



Now the simple one :



4) READ CAREFULLY TABLE 12 of datasheet that is page 23 if Rev.A document



The story is : SEND FIRST HEX 1803 to enable wiper position

Then if want update wiper : SEND COMMAND 1 (TABLE 11)

Then if want verify : SEND COMMAND 7



Conclusion

Before wiper and / or 20TP memory may be updated HEX 1803 must be sended to DAC register, then this DAC works perfectly!.

*PS (I Hope must be helpful)



Aldo Ferraro - CONSULTANT

ELDEV ELETTRONICA

MILANO


Hi, I'm trying to use an AD5291 as a variable resistor for the variable gain in a signal generator board, it's not working at all, and even if I try to initialize it with different values it just uses the default value (half of the nominal resist value).
This is my init pot function:
void spi_init_pot()
{
uint8 i, tmp;
uint8 init_data[] = {0x18,0x03,0x05,0x00,0x08,0x00,0x0c,0x00,0x1c,0x00,0x00,0x00};

for (i=0; i<6; i++)
{

SS_POT = 0; // Slave select 0
SS_POT_DIR = 1;

SPI2D = init_data[(i*2)]; // 2 bytes of data
while (!SPI2S_SPTEF || !SPI2S_SPRF) // FF - max out (VDD)
tmp = SPI2D; // 00 - min out (GND)

SPI2D = init_data[1 + (i*2)]; // 2 bytes of data
while (!SPI2S_SPTEF || !SPI2S_SPRF) // FF - max out (VDD)
tmp = SPI2D; // 00 - min out (GND)

SS_POT = 1; // Slave select 1
SS_POT_DIR = 0;

}
}

This is my setting different value function:
void spi_set_pot(RX_msg_struct *t)
{
uint8 i, temp;

if((t->D_Len - 0x03) == 0x02)
{

SS_POT = 0; // Slave select 0. modified by Bellina
SS_POT_DIR = 1;

for (i=0; i<2; i++)
{


SPI2D = t->DB; // 2 bytes of data
while (!SPI2S_SPTEF || !SPI2S_SPRF) // FF - max out (VDD)
temp = SPI2D; // 00 - min out (GND)


}

SS_POT = 1; // Slave select 1
SS_POT_DIR = 0; // modified by Bellina

}
}
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top