Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

AD5220 digipot goes to limit in 1 pulse

good day,

I got a AD5220 digital poti and data sheet says, I only need so switch a push button to change the resistance. Off course also need to select up / down and pull CS low to enable. And get a pull up resistor happening (which is not in the manual, but you need it). But as soon as I pull the CLK input low, it just goes all the way, not just 1 step. I then tried all sorts of debouncing circuits, no joy. Nothing to see on the oscilloscope either, CLK goes from 5 to 0 V without any other noise, so no bounce there. Then hooked up a square wave generator, set to 1 HZ, first pulse and resistance went from 50% to 0.
Manual says it goes 1 step per pulse and for testing one can use a manual switch

Not here to discuss why I am not using SPI.

Thanks in advance for any help.

1709965194509.png

1709965620661.png
 
Datasheet not exactly the best.

Seems like as long as CS is low it will keep inc/dec on clock edges until it
hits high/low limit.

Clk pin does need a P/U as it is - edge sensitive, so if using with a debounced
push button idle state must be high.

Do you have a DSO so you can do a one shot capture of pins when powered up ?
To see if you are not generating false clocks while supply is ramping up. If power
sequencing at issue you could always power part off micro GPIO pin as its current
requirements quite low. Eg. to power up part after micro up and running.

Do you have a Chinese knockoff of the part or a real Analog Devices part ?


Regards, Dana.
 
-its a proper AD chip (I hope), got it from Farnell
-its all sitting nicely at 5 V now when I power up. Put an Ohmmeter on, resistance starts somewhere high and settles halfway. At 5 kOhm (as its 10k Poti). As soon as I pull CLK to 0V the resistance drops to 0. Or if I set it for up, goes straight to 9.2k (that's another thing, upper limit is always just 90%. 100k poti gets 90k max). In other words it will stay at one value forever until CLK is pulled low. Chip is starting OK.
Does the CLK have to pulse the entire time and I just set enable when its meant to change? That is way to slow. It says falling edge. I.e. a change. When its constantly LO (or HI for that matter) its not an edge?
 
Do you have a debounce circuit on the CLK signal, that produces a clean, fast edge?

For any kind of switch, I'd suggest an R-C filter into a schmitt gate, or a changeover switch to an S-R bistable, to give clean single clock edges each time the switch is operated.

A normal switch can give multiple contact bounces, or a slow signal to a non schmitt input can allow the input to oscillate.
 
Last edited:
ok, asked at ADI engineer zone. For now they only response I got is I still need to maintain the clock. So I guess I need to find a different chip. Why does the datasheet then say it can be manually tested? Its much easier to control the resistance if the wiper is moved when its needed. Not enable / disable and hope one gets the number of pulses right. Very roundabout way of doing this.
 
Don’t change the Digipot, not yet.

If you can get your hands on a 555, build an astable oscillator. Connect its output to the Digipot’s clock input. You will then see a waveform like the one shown on the datasheet.

If the digipot behaves correctly this way, then you definitely require to debounce the switch.
 
Does sound like you may have a faulty chip.
 
I did debounce, see post 5. Tried all sorts of resistors. And used square wave generator as well, same outcome. May well try a 2ns chip, I bought 3. And meanwhile ordered X9C103S board online, should arrive soon. Entire board cost as much as one AD5220, and seemed to work with 1 Hz frequency at youtube
 
I did debounce, see post 5. Tried all sorts of resistors. And used square wave generator as well, same outcome. May well try a 2ns chip, I bought 3. And meanwhile ordered X9C103S board online, should arrive soon. Entire board cost as much as one AD5220, and seemed to work with 1 Hz frequency at youtube

As I said in post #4, that circuit doesn't debounce - unless you're feeding it through a schmitt trigger, and even then that is a VERY poor debouncing circuit.

The digikey link in post #10 is a good reference - I use similar to figure 3 from that page (but mostly don't use the diode). I did a fair amount of research, and tried the circuit you posted above, even with a schmitt trigger it was too poor to work. The version with two resistors (as figure 3) cured all the problems - originally I used an external schmitt trigger, and later moved to use a PIC which has the option of setting all I/O pins to be schmitt inputs. If you set the I/O to be a normal input, there's no debouncing then either.

But if you've used a square wave generator, that should work fine - I'm presuming you weren't using a relay between generator and chip? - which I did deliberately for testing purposes, and for evaluating if I needed a diode or not (you can run faster pulses with the diode). Using a squarewave generator and a relay allowed much easier testing, and display of the actual 'bounce' on the contacts - and one of the major applications would be fed from a relay.
 
A quick way to eval your debounce circuits use your DSO, set for single trigger/single shot
mode, timebase ~ 5 mS / box, and see what you get. A cmos gate w/o hysteresis, as inpost
5, eg. the input, can sit long enough (with a cap tied to input) at threshold that with
power supply noise can cause gate to oscillate. Look at your power supply rail with DSO,
set to infinite persistence, say 1 mS / box, AC, 100 mV vertical sensitivity, and see how much
pk-pk noise you have. Its usually an eye opener.


Regards, Dana.
 
A quick way to eval your debounce circuits use your DSO, set for single trigger/single shot
mode, timebase ~ 5 mS / box, and see what you get. A cmos gate w/o hysteresis, as inpost
5, eg. the input, can sit long enough (with a cap tied to input) at threshold that with
power supply noise can cause gate to oscillate. Look at your power supply rail with DSO,
set to infinite persistence, say 1 mS / box, AC, 100 mV vertical sensitivity, and see how much
pk-pk noise you have. Its usually an eye opener.

Yes, very much so, I was staggered when I checked with my DSO. I was also amazed when I did my relay test, using a small reed relay.
 
I want to run it with a small PLC and use its digit al outputs. Unfortunately its mechanical relais. The resistance has to change pretty slow, so push button would do the trick. I almost feel its easier to use a servo motor and mechanical poti
 

Latest threads

New Articles From Microcontroller Tips

Back
Top