+ Post New Thread
Results 1 to 11 of 11
  1. #1
    Advanced Member level 5
    Points: 30,735, Level: 42
    Achievements:
    7 years registered

    Join Date
    Sep 2008
    Location
    cambridge
    Posts
    6,423
    Helped
    470 / 470
    Points
    30,735
    Level
    42

    Decrementing a digital pot to get zero resistance.

    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
    http://ww1.microchip.com/downloads/e...Doc/21978c.pdf


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

    •   AltAdvertisment

        
       

  2. #2
    Advanced Member level 5
    Points: 34,662, Level: 45
    Achievements:
    7 years registered Created Blog entry Created Album pictures
    SunnySkyguy's Avatar
    Join Date
    Sep 2007
    Location
    Richmond Hill, ON, Canada
    Posts
    6,684
    Helped
    1671 / 1671
    Points
    34,662
    Level
    45
    Blog Entries
    7

    Re: Decrementing a digital pot to get zero resistance.

    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?
    A good design question lists your overall requirements™ The best question deserves a better answer. ™
    ... Tony Stewart EE since 1975


    1 members found this post helpful.

  3. #3
    Advanced Member level 5
    Points: 12,735, Level: 27
    Achievements:
    7 years registered

    Join Date
    Nov 2008
    Location
    Norwich, UK
    Posts
    2,123
    Helped
    598 / 598
    Points
    12,735
    Level
    27

    Re: Decrementing a digital pot to get zero resistance.

    why not use a MCP41010
    http://www.microchip.com/wwwproducts...oduct=MCP41010

    you can set the wiper position (rather than increment and decrement) and it has a simple SPI interface
    we used this device a few years ago to generate a 2KHz sine wave


    2 members found this post helpful.

  4. #4
    Advanced Member level 5
    Points: 30,735, Level: 42
    Achievements:
    7 years registered

    Join Date
    Sep 2008
    Location
    cambridge
    Posts
    6,423
    Helped
    470 / 470
    Points
    30,735
    Level
    42

    Re: Decrementing a digital pot to get zero resistance.

    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 treez; 15th September 2014 at 06:20.



  5. #5
    Advanced Member level 5
    Points: 30,735, Level: 42
    Achievements:
    7 years registered

    Join Date
    Sep 2008
    Location
    cambridge
    Posts
    6,423
    Helped
    470 / 470
    Points
    30,735
    Level
    42

    Re: Decrementing a digital pot to get zero resistance.

    Please help with the MAX5482 Digital pot datasheet..
    http://datasheets.maximintegrated.co...81-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?



    •   AltAdvertisment

        
       

  6. #6
    Super Moderator
    Points: 75,009, Level: 66
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    12,292
    Helped
    4079 / 4079
    Points
    75,009
    Level
    66

    Re: Decrementing a digital pot to get zero resistance.

    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.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.


    1 members found this post helpful.

  7. #7
    Advanced Member level 5
    Points: 30,735, Level: 42
    Achievements:
    7 years registered

    Join Date
    Sep 2008
    Location
    cambridge
    Posts
    6,423
    Helped
    470 / 470
    Points
    30,735
    Level
    42

    Re: Decrementing a digital pot to get zero resistance.

    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)



  8. #8
    Super Moderator
    Points: 75,009, Level: 66
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    12,292
    Helped
    4079 / 4079
    Points
    75,009
    Level
    66

    Re: Decrementing a digital pot to get zero resistance.

    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.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.


    1 members found this post helpful.

  9. #9
    Advanced Member level 5
    Points: 30,735, Level: 42
    Achievements:
    7 years registered

    Join Date
    Sep 2008
    Location
    cambridge
    Posts
    6,423
    Helped
    470 / 470
    Points
    30,735
    Level
    42

    Re: Decrementing a digital pot to get zero resistance.

    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



    •   AltAdvertisment

        
       

  10. #10
    Super Moderator
    Points: 75,009, Level: 66
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    12,292
    Helped
    4079 / 4079
    Points
    75,009
    Level
    66

    Re: Decrementing a digital pot to get zero resistance.

    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.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.


    1 members found this post helpful.

  11. #11
    Advanced Member level 5
    Points: 30,735, Level: 42
    Achievements:
    7 years registered

    Join Date
    Sep 2008
    Location
    cambridge
    Posts
    6,423
    Helped
    470 / 470
    Points
    30,735
    Level
    42

    Re: Decrementing a digital pot to get zero resistance.

    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.



--[[ ]]--