Searching \ for 'Setting OpAmp gain with PIC?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Setting OpAmp gain with PIC?'.

Truncated match.
PICList Thread
'Setting OpAmp gain with PIC?'
1998\06\30@152526 by Rob Santello

flavicon
face
Question(s),

Currently I am controlling the gain of a typical non-inverting OpAmp
circuit by switching in parallel resistances in the "R1" leg to ground of
the inverting input of the OpAmp.  The "R2" feedback resistor remains
fixed. I do this with 3 PIC outputs controlling three 4066 switches with
the resistors in series with the switches.  By using 3 outputs I get 8 gain
settings. Since I am just adding resistors in parallel to ground, is it
possible to omit the 4066 and effectively provide a ground (or high Z for
unselected condition) to each resistor?  If so, would I then set the PIC
pin as an input for the high Z state, and as an output "low" for a ground?
Is this the best way to do this?

Since I'm already asking about this ... ideally, more gain settings would
be nice.  Without using more PIC pins, I see the best way to do this would
be with a 3 wire Dallas digital pot IC.  I'm hoping "8 is enough", but if
not, is there a better/cheaper/easier way than with the Dallas part?

Thanks for any advice...
--rob--

1998\06\30@164038 by Dwayne Reid

flavicon
face
>Currently I am controlling the gain of a typical non-inverting OpAmp
>circuit by switching in parallel resistances in the "R1" leg to ground of
>the inverting input of the OpAmp.  The "R2" feedback resistor remains
>fixed. I do this with 3 PIC outputs controlling three 4066 switches with
>the resistors in series with the switches.  By using 3 outputs I get 8 gain
>settings. Since I am just adding resistors in parallel to ground, is it
>possible to omit the 4066 and effectively provide a ground (or high Z for
>unselected condition) to each resistor?  If so, would I then set the PIC
>pin as an input for the high Z state, and as an output "low" for a ground?
>Is this the best way to do this?

That should work just fine.  Do test it, however, to make sure that it does
what you need.

How have you biased the op-amp?  Have you provided both + & - supplies or is
this a single supply thingy.  If the amplifier is expected to amplify AC and
you are using a single supply with the (+) input biased at 1/2 the supply
voltage, you will need a series coupling capacitor from the common point of
the resistors to the op-amp (-) input.  The capacitor allows the DC bias to
remain constant while allowing the AC gain to change with resistor value.

Also note that you should include a large value resistor from the resistor
side of the coupling capacitor to GND so that the capacitor always has the
correct voltage on it.  If you switch from lowest gain (no resistors to GND)
to any other value of gain, you will see a "thump" in the output as the
capacitor charges.

Hope this helps.

dwayne


Dwayne Reid   <spam_OUTdwaynerTakeThisOuTspamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(403) 489-3199 voice     (403) 487-6397 fax


'Setting OpAmp gain with PIC?'
1998\07\04@225632 by paulb
flavicon
face
Dwayne Reid wrote:

> If the amplifier is expected to amplify AC and you are using a single
> supply with the (+) input biased at 1/2 the supply voltage, you will
> need a series coupling capacitor from the common point of the
> resistors to the op-amp (-) input.

> Also note that you should include a large value resistor from the
> resistor side of the coupling capacitor to GND so that the capacitor
> always has the correct voltage on it.

 Err, ummph, well, it may not be as simple as that.  Obviously to bias
the capacitor you want to have a permanent resistor to ground,
corresponding to the minimum (or maximum if this happens to be in the
negative feedback path) gain setting.

 Whether you use the capacitor for a single-supply system, or use a
split-supply for the op-amps, the use of such a circuit on AC means that
an open switch could be subjected to a negative voltage.  If that
voltage (corresponding to the resistor common point) exceeds -0.6V, the
protection diode will kick in and things are no longer linear.

 Sorry, there is no easy answer for the AC switching case.
--
 Cheers,
       Paul B.

1998\07\05@204027 by Dwayne Reid

flavicon
face
{Quote hidden}

You are right if the input signal exceeds about 0.5V peak.  The op-amp (-)
input has to track the (+) input for the feedback loop to close.  But for
gains larger than 10 or so, there should be no problem (and, somehow, I
thought that was the case).

My feeble attempt at ASCII art: (monospace font)

                              |\
  input & bias----------------|+ \
                              |   >--------- out
                         -----|- /     |
                         |    |/       |
                         |             |
                         |----/\/\/\/--
                         |
     pic                ===  cap
   -------               |
   |     |---/\/\/\------|
   |     |---/\/\/\------|
   |     |---/\/\/\------|
   |     |---/\/\/\------|
   |     |---/\/\/\------|
   |     |               / this resistor sets minimum gain and ensures
   |     |               \ that the DC charge on the cap stays the same
   |     |               / even if all the pic pins are tristate.
   |     |               \ It can be eliminated if at least 1 pic pin
   -------               | is set to LO at all times.
                        gnd

dwayne







Dwayne Reid   <.....dwaynerKILLspamspam@spam@planet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(403) 489-3199 voice     (403) 487-6397 fax

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...