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.

Decrementing a digital pot to get zero resistance.

Status
Not open for further replies.
T

treez

Guest
Newbie level 1
Hello,
I wish to use a digital pot as a low side potential divider resistor. (having 64 taps) Every time I wish to set its value, I wont know the current position of the wiper, so...in order to start from a known place (ZERO), we intend to send 70 'decrement' pulses to it......in my understanding, this will definitely take the resistance down to zero...(as theres no overflow and theres only 64 'steps').
Do you agree?

MCP4014 digital pot
https://ww1.microchip.com/downloads/en/DeviceDoc/21978c.pdf


it looks to me that the "serial interface" to which they refer is just a "bit bashing" protocol...which we like
 

Note: The wiper value will not underflow. That is,
once the wiper value equals 0x00,
subsequent decrement commands are ignored.


Why not use a simple DAC?
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
  • Like
Reactions: treez and FvM

    FvM

    Points: 2
    Helpful Answer Positive Rating
    T

    Points: 2
    Helpful Answer Positive Rating
thanks but both your recommendations require more software effort...bit banging the i2c or spi protocols is more software than the simple digi pot software.

So anyway, thanks, every time we need to set a value, we will simply send 70 decrement pulses , and then give the required setting by way of increments from there.

In the MCP4014, it says the resistance value is +/-20%, but the datasheet doesn't say whether the step resistances are equal to each other or not...I mean, how different is one "step" resistance likely to be to the others?
 
Last edited by a moderator:

Please help with the MAX5482 Digital pot datasheet..
https://datasheets.maximintegrated.com/en/ds/MAX5481-MAX5484.pdf

...it says the "differential non linearity" is 1 LSB, but that for the 10K pot, the maximum resistance is 12.5k.
This doesn't make sense.
1 LSB = 10K/1023 = 9.8 Ohms.
so that means every step could actually be 19.6 ohms...that would give a total resistance of 1023 * 19.6 = 20K.

Do you agree the datasheet doesn't make sense?
 

Before looking at different digital potentiometers, ask the question, 'what does the potentiometer do?'. They are best suited to scaling existing analog signals, if you want to produce a variable voltage from scratch, there are better ways to do it. Bear in mind also that you can use almost any DAC as a digital potentiometer, in most cases when they are internal to a microcontroller. All you need is external access to the reference voltage.

Brian.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
thanks, but the pic range tend not to come with DAC's.
Also, DAC's almost invariable demand I2C protocol to interface to them.
Simple digi pots like MCP4013 just have a simple up/down protocol.
Looking at page 41 of the MCP4013 datasheet, its more accurate than I thought.......(considering the 2k1 digi pot) its not that every step can be 38 ohms +/- 8 ohms.........because that would mean 10 steps could be 400 ohms....this is not possible, in fact, from page 41, 10 steps could be 380 ohms +/- 8 ohms.....would you agree.

We are a production company , we do not have software engineers in house, we need an adjustable voltage ...64 steps between 0 volts and 1.2 volts....we would like to be able to to set the voltage to +/- 40millivolts.....however, the accuracy can be UP TO +/-100millivolts when below 0.2V.

Do you agree that 10 steps could be 380 ohms+/- 8 ohms? (for the 2k1 pot)
 

I'm accessing with my mobile phone so can't check the data sheet at the moment but I would assume the error per step is not cumulative so it may be more accurate than first appears.

It seems you are trading off hardware against some very simple software. Almost all PICs have a PWM generator on board which can produce 0 - VCC in up to 1023 steps and very accurately. You only need one pin, a couple of resistors and a capacitor to produce 0 - 1.2V with accuracy of about 1mV. The voltage is set by simply writing a number to the PWM register, simpler than writing to an external device.

Brian.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
thanks, though I find very few pics have a PWM module, and instead it is a "CCP module", and you have to battle with that to get your PWM...not so easy
 

I disagree, there are two or three bits in most PICs to configure the CCP registers to work in PWM mode, after that you just write a value to one (two for greater accuracy) of the registers to set the output voltage. As you are only looking at 64 steps instead of the potential 1023, you can ignore the register that 'fine tunes' the smallest voltage increments.

CCP in PWM mode is basically two counters, one continuously counts to set the PWM rate and the other starts counting at the same time but gets cut short by the value your program. The difference between the timer values decides the PWM ratio.

Brian.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
ill think about that.......by the way, your explanation of how CCP works is the very first time that I have understood how CCP works.....as you know, microchip app notes are very poor (as are all micro co's) because the apps guys are moonlighting and so don't want to explain things well to people....it only creates more job competitors in the market for them.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top