CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

For anyone who chooses to use the AD5292 in a new design...

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

For anyone who chooses to use the AD5292 in a new design...
PostPosted: Tue Dec 13, 2016 9:44 am     Reply with quote

I just finished two of the most frustrating weeks of my entire life, spent trying to properly communicate with this digital potentiometer. I thought I'd lay out some guidelines here for anyone who chooses to use this beast in a design.

- If you're designing a new PCB, strongly consider incorporating the ability to switch the power supplies on by software control. The AD5292 can be very finicky about its power rails and the order in which they're powered up. Pay attention to the "power-up sequence" section of the datasheet. The logic supply must come up first, followed by the analog supply, and finally any voltage present on the digital pot terminals itself.
- Resist the urge to hard-wire the /RESET and READY signals. It's best to bring all digital lines back to an I/O on your processor. Do not leave the MISO line unconnected - you're probably going to need it for troubleshooting if nothing else. Pay attention to which lines are open drain.
- The AD5292 uses SPI mode 1 (which is quite rare). Your SCLK and MOSI lines MUST be low before you attempt to access the chip. I also found I couldn't get anywhere near the datasheet stated max SPI clock frequency.
- The AD5292 powers up in a protected mode (wiper can't be changed). The first thing you have to do is set the appropriate bit in the AD5292's config register to unlock it.
- You CANNOT chain together multiple SPI commands/reads into a single transaction. You absolutely MUST toggle the /CS line low, clock in 16 bits, then bring /CS high again. You can't attempt to exchange more than 16 bits at a time. The AD5292 will respond with any reads or the echo of data clocked in on the next transaction you initiate.
- Be careful with attempting to manually toggle the /RESET line low. In some instances it can result in the AD5292 locking up/not responding to commands.
- Normal behaviour for the READY line is to default high but momentarily pull low after the successful exchange of a command. Wait for the line to go high again before attempting the next transaction.

In general I had everything down except for the power supply sequencing and the /CS behaviour (must be cycled every 16 clocks). I've found that the sequencing on my board, though slightly out of spec, seems to be okay but given the issues I've had with this thing I'm warning anyone else to pay attention to it. In troubleshooting this thing, AD recommended that I try manually asserting the /RESET line which I had tied to 3.3V on my board. With some difficulty I bypassed the READY signal (which I did bring back to my PIC, luckily) and used that to assert the /RESET. ....Which I eventually found actually bricked the AD5292 for some reason I fail to understand (AD too). Once I left that line pulled high once more, I eventually got this thing to respond/work.

One other weird thing about the AD5292, which I didn't catch until I started having problems with it is that the datasheet, in bold at the top of the front page states that the single supply operation range is +9V to +33V. Directly under that, in the General Description - first paragraph: single supply operation is +21V to +33V. I complained to AD about this. From what I gather, I believe that the stated +/- 1% accuracy holds for +21V to +33V but the chip works over the wider +9V to +33V range but with reduced accuracy - but I can't find anywhere in the datasheet that actually says this.

To add insult to injury, in desperation I bought the AD5292 evaluation board....which didn't work with my PC for some reason which AD still can't figure out.

All this aside, I'd recommend that you strongly consider using a different digital potentiometer in your design, such as the Microchip MCP41HVx1.

Hope this helps.
temtronic



Joined: 01 Jul 2010
Posts: 9246
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Dec 14, 2016 9:44 am     Reply with quote

Got ANY hair left ??? I do feel your pain as it's got worse for the past 2-3 decades.

Some days you have to ask yourself did the 'engineer' who designed the thing ACTUALLY try to use it in the Real World ?

At least you were warm and toasty...I just spent 4 frigid HOURS on a 1 yr old snowblower that a NORMAL human cannot access the controls (choke is kinda important up here...) even without Winter mitts on.
Funny thing is the 23 year old unit (which sat 3 years in the barn), fresh gas, choke, pull and GO !!!

I am very,very leary of ANY new product and as most here know, I use the 18F46K22 for 99% or my product...waaay overkill BUT it's tried and true.

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19552

View user's profile Send private message

PostPosted: Wed Dec 14, 2016 10:05 am     Reply with quote

Yes. I've been running through a similar problem the last few weeks with a Chinese chip. Eleven releases of the data sheet. None actually 'right'. Thankfully a lot of similarities with an older chip for which some correct data does exist. With the latest sheet and the old data, it eventually works...

Whimper.
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Wed Dec 14, 2016 10:24 am     Reply with quote

You're a brave man. I was once encouraged to use a Chinese IC but once I had a look at the datasheet I instead found a similar chip from one of the big manufacturers. I can't say whether the chip itself is good or bad but given the documentation I couldn't honestly dedicate the development time to the task to save a few cents per finished unit.

I also remember from perhaps a decade ago, Circuit Cellar magazine had a sponsored contest which specified the use of a certain Chinese made wifi bridge IC. There were a lot of posts from contestants regarding the configuration of that chip and problems with the data sheet.

Chinese tools, however, seem to be different/improving. At my last job we purchased an IR reflow oven and an automated wire cutter/stripper unit from ebay - both Chinese manufactured. The user manuals were cryptic (to put it mildly), but both turned out to be very surprisingly well made.

At present I'm eyeing another Chinese ebay item, an HDMI extender pair of devices which use a cat 6 Ethernet cable to extend an HDMI video link. A facility where I volunteer has a video projection system which sort of/kind of/almost works, and I'm 100% sure that the cable length is the issue. For $40 I'm thinking the risk is worth seeing if the problem goes away.
guy



Joined: 21 Oct 2005
Posts: 297

View user's profile Send private message Visit poster's website

PostPosted: Wed Dec 14, 2016 1:51 pm     Reply with quote

"It always works in the end, but only because The End is defined by the moment it starts working...."
Ttelmah



Joined: 11 Mar 2010
Posts: 19552

View user's profile Send private message

PostPosted: Thu Dec 15, 2016 1:37 am     Reply with quote

guy wrote:
"It always works in the end, but only because The End is defined by the moment it starts working...."


I like this. Totally fitting to many electronic products.

Very Happy

To Newguy, the CS behaviour is quite common. A lot of Texas chips in particular work like this. It is a very good way of ensuring clock synchronisation, even if other devices are on the same bus (which is why it is done). #use spi can actually handle this for you.
guy



Joined: 21 Oct 2005
Posts: 297

View user's profile Send private message Visit poster's website

PostPosted: Thu Dec 15, 2016 6:45 am     Reply with quote

another nice sentence is "You can look 3 days for a bug. It will still be a just a small bug."
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Thu Dec 15, 2016 7:16 am     Reply with quote

Using v4.141 and the dsPIC I'm using isn't properly supported in a lot of ways so I never bothered trying #use SPI. Too used to setting things up manually I guess. More bother in development but processor speed (doing things) seems much higher.

As for sayings, the one I always keep coming back to (applies in my case too) is, "experience is something you don't get until after you needed it."
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Tue Jan 03, 2017 1:00 pm     Reply with quote

Update...

Turns out that when I got this chip working a couple of weeks ago, it was actually mostly blind luck and only partially working. Once I eliminated my code as the source of the weirdness, I had to dig back into the nitty-gritty interface with this beast.

What I've learned is that if you don't follow the power sequencing requirements to the letter (and I can't given my hardware), the chip will still work but only at a very slow SPI clock rate. The chip supports a 25MHz clock, but I had to dial it down to 625kHz before it started working 100% reliably.
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Fri Feb 17, 2017 1:47 pm     Reply with quote

Another update. This chip just keeps getting better.

SPI is simple, right? Connect 4 lines - clock, MOSI, MISO and a /CS line and you're good to go. Have other SPI devices? They share the clock, MOSI and MISO lines and all you need are more /CS lines.

The AD5292 is rather special. Turns out it doesn't release the MISO line when its' /CS is raised. Actually, it powers up as driving the MISO line. ...Sometimes. ....Actually, most of the time.

Finally got back to firmware this week and started work on a very bog standard EEPROM driver. Something I've done quite literally a hundred times before. This particular EEPROM comes pre-programmed with a unique 64 bit serial number. And I couldn't read anything from it. Which caused me to question my proven EEPROM driver code for several frustrating days. Until this morning when I started to suspect the spawn of satan, the AD5292.

Buried in its datasheet is mention of a special set of commands to tell it to release the MISO line (place it in Hi-Z mode). And those special commands aren't listed in the table of recognized commands. ...Which makes you question whether they're valid or a typo. Someone over on the AD EngineerZone summed this IC up pretty well: https://ez.analog.com/thread/18984

Beware, beware, beware. This digital pot is the single most frustrating part I've ever used. And now I have several EEPROMs that I've managed to damage because they were attempting to drive the MISO line high while the AD5292 was holding it low. I really dislike AD at the moment.
temtronic



Joined: 01 Jul 2010
Posts: 9246
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Feb 17, 2017 2:40 pm     Reply with quote

got ANY hair left ??

Man I feel for you, BTDT with some odd ball parts like decades ago...today I'd expect mfrs to RESPECT the 'standards'.
Then again to me RS-232 is supposed to be on a DB-25 connector NOT a DE-9, where txd and rxd are on the wrong pins......

Looking forward to next month's update!

Jay
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Fri Feb 17, 2017 4:02 pm     Reply with quote

temtronic wrote:
Looking forward to next month's update!


I'm not.

I reflowed solder, I was touching the board in various places to see if that made a difference, I was even throwing in debug dumps to see the state of the TRIS register because for a while I was convinced it was somehow changing from input to output.

I truly, truly hate AD right now. And I'm remembering a certain AD 3 axis accelerometer that I had issues with years ago and wondering if my problems weren't caused by a borderline SPI interface....
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group