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.

Digital Potentiometer

Status
Not open for further replies.

SneaKSz

Member
Hi guys,

I'm trying to use the MCP41050 as variable resistor.

(https://www.electro-tech-online.com/custompdfs/2012/05/11195c.pdf)

this is the setup :

2cy1yzq.jpg


Here is the code to set the pot to 26K :
Code:
    Chip_SelectPot = 0;                       // Select POT chip
    SPI1_Write(0x11);                      // write & pot1
    SPI1_Write(0x80);

    Chip_SelectPot = 1;
    Delay_ms(100);

This code is working and when I measure the resistance between A and B, there is 26K. Now when I attach the wires to meet the setup and I apply an input voltage, the Gain is not correct.

I thought the gain would be : - (28.2)/(6.5) ~-4x. The gain effectively is round 2x.

Someone has any experience with using the digipot in a opamp circuitry?

kind regards
 
Last edited:
I can't comment on the code, but have you considered whether you might be exceeding the absolute maximum ratings of the digital potentiometer (see p.5 of datasheet).

How are you powering it? What will be your maximum input swing? The ±12V supply to the op-amp makes me wonder whether the voltage between A and B might exceed the limits.

John

Edit; Also check out Figure 2 on page 2 here.
 
Last edited:
Hi jpanhalt,

I'"m powering it with V+=12V and V-=-12V, the maximum input swing will be arround 4V.

Well on fig2 page 2, they have the Rfb and the pot in 1 IC. In my circuitry I want to use it just as a single pot.

Thanks for the comment !

EDIT : on page 5 of the DS 'All inputs and outputs w.r.t. VSS ............... -0.6V to VDD +1.0V', this could be the problem
 
Last edited:
As you noted from the spec sheet, most (if not all) digital pots require one end of the pot to be at ground potential thus they cannot be used in a floating application.

You could use it connected to ground to vary the gain in a non-inverting op amp configuration.
 
Hello crutschow,

I could try the circuit you are mentioning , in that way the pins would never exceed the Vdd (5V), because the V notinv wouldn't be > 4V.

I'll try and make that work.

Where did you find that one end of the digipot should be connected to gnd? Because in the datasheet fig2.30 is the circuit I'm based on.

Kind regards !
 
digital potentiometer?the unicorn, A horse , but not? a mystical creature , some people think they exist yet no one has seen one? as a famous person once told me......a digital potentiometer has a +20% to -20% true....... a magical thing with 30's tolerances?hmmmm......... I am looking forward to the unicorn of IC's.........gnd, I assume not floating (or isolated) ∏
 
Last edited:
Hello crutschow,

I could try the circuit you are mentioning , in that way the pins would never exceed the Vdd (5V), because the V notinv wouldn't be > 4V.

I'll try and make that work.

..........
I misspoke (again :eek:). I didn't properly look at the data sheet. Either or both resistor terminals can be above ground as long as they are within the voltage range of Vdd to ground.
 
Figure 2-30 has a 2.5volt DC offset at the non-inverting input. This causes the output to be centered around +2.5Volts, so that all terminals of the pot are always between 0 and +5V. In your circuit, the pot terminals will need to swing below ground.

To make your circuit work you need to do something similar. You will need to run your op-amp at a single 5V rail with a DC offset. AC couple the input and output with capacitors.

Depending on the magnitude of the signal you are working on, you may need to attenuate the input first, then make up for the lower voltage with a fixed gain AC amplifier after the variable gain stage.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top