Author Topic: PICs with Op Amps: Non-inverting? Off-piste?  (Read 1257 times)

0 Members and 1 Guest are viewing this topic.

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2507
  • Country: gb
PICs with Op Amps: Non-inverting? Off-piste?
« on: March 30, 2020, 09:22:57 am »
I'm thinking about using a DSPIC33EV256GM006-I/PT for a small project and one of my requirements is to sense current through a device...

... my plan is to have a 1 0.22 ohm sense resistor and then a x10 x100 gain Op Amp into the ADC.  I would like to utilise on onboard OP1 with Rf 18k Rin 2k in a non-inverting configuration.

But... all the datasheets and tech notes seem to always show inverting configurations? Am I missing something?  Will non-inverting work?
« Last Edit: March 31, 2020, 04:15:52 pm by NivagSwerdna »
 

Offline fourtytwo42

  • Super Contributor
  • ***
  • Posts: 1218
  • Country: gb
  • Interested in all things green/ECO NOT political
Re: PICs with Op Amps: Non-inverting? Off-piste?
« Reply #1 on: March 30, 2020, 09:28:37 am »
Shouldn't be a problem, I use them that way in PIC24EP256MC202 and others.
As you are doing current sensing beware Vcmr includes AVss but not below it.
« Last Edit: March 30, 2020, 09:33:41 am by fourtytwo42 »
 
The following users thanked this post: NivagSwerdna

Online David Hess

  • Super Contributor
  • ***
  • Posts: 17428
  • Country: us
  • DavidH
Re: PICs with Op Amps: Non-inverting? Off-piste?
« Reply #2 on: March 31, 2020, 01:47:12 am »
The reason only inverting configurations are shown is revealed in the specifications if you know where to look.  The common mode rejection is a horrible 45dB *typical* or 1:178 so for every volt of change in the non-inverting input, the input offset voltage changes by 5.6 millivolts, and it could be *worse* than that.  (1) The poor common mode rejection comes from having a rail-to-rail input and being produced on a digital CMOS process.  The other DC specifications are equally poor as expected.

(1) This cannot be treated as a gain error because it is non-linear.
 
The following users thanked this post: thm_w, NivagSwerdna

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2507
  • Country: gb
Re: PICs with Op Amps: Non-inverting? Off-piste?
« Reply #3 on: March 31, 2020, 10:15:55 am »
The reason only inverting configurations are shown is revealed in the specifications if you know where to look.
That's really interesting.

CM40 VCMR Common-Mode Input Voltage Range               AVSS                            —                     AVDD                 V
CM41 CMRR Common-Mode Rejection Ratio                         —                             45                       —                    db                VCM = AVDD/2

... and in inverting mode there is less CMRR error since both inputs held to ground (or virtual ground) and hence no CM dynamic voltage.  Thanks for that!
« Last Edit: March 31, 2020, 10:27:36 am by NivagSwerdna »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20363
  • Country: gb
  • 0999
Re: PICs with Op Amps: Non-inverting? Off-piste?
« Reply #4 on: March 31, 2020, 01:51:50 pm »
Other than what's already been mentioned above, the only thing I can add is non-inverting configuration has a higher noise gain, than inverting, so it will be less stable, but if the op-amp is unity gain stable, it won't be a problem.

A couple of threads discussing noise gain and inverting/non-inverting configuration.
https://www.eevblog.com/forum/beginners/op-amp-spec-noise-gain-configuration/
https://www.eevblog.com/forum/projects/inverting-vs-non-inverting-pros-and-cons/
 

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2507
  • Country: gb
Re: PICs with Op Amps: Non-inverting? Off-piste?
« Reply #5 on: March 31, 2020, 03:18:56 pm »
I'm tempted to just put a INA180B3 into the design
 

Online David Hess

  • Super Contributor
  • ***
  • Posts: 17428
  • Country: us
  • DavidH
Re: PICs with Op Amps: Non-inverting? Off-piste?
« Reply #6 on: March 31, 2020, 05:36:50 pm »
... and in inverting mode there is less CMRR error since both inputs held to ground (or virtual ground) and hence no CM dynamic voltage.

That is right; if the common mode voltage is not changing then there is no common mode error.  And for the same reason, inverting mode has less distortion than non-inverting mode.

45 dB of common mode rejection is truly horrible, and barely better than the first modular tube operational amplifiers 50 years ago.  Good precision parts are 120 dB or 1 microvolt per volt.  Chopper stabilized amplifiers can be 160 dB.  "High performance" operational amplifiers like the 741 set the standard at 90 dB typical.
 

Offline fourtytwo42

  • Super Contributor
  • ***
  • Posts: 1218
  • Country: gb
  • Interested in all things green/ECO NOT political
Re: PICs with Op Amps: Non-inverting? Off-piste?
« Reply #7 on: March 31, 2020, 07:04:39 pm »
My view for what it's worth is that one should not approach microcontrollers integrating analogue electronics from a precision point of view, rather they are a means of increasing circuit density and reducing component count. If anybody want's a precision solution they should be using separate components that will always be better.
 

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2507
  • Country: gb
Re: PICs with Op Amps: Non-inverting? Off-piste?
« Reply #8 on: March 31, 2020, 09:08:03 pm »
My view for what it's worth is that one should not approach microcontrollers integrating analogue electronics from a precision point of view, rather they are a means of increasing circuit density and reducing component count. If anybody want's a precision solution they should be using separate components that will always be better.
It's a trade-off.... but one that can only be made once you understand the limitations... As was mentioned above.... CMRR is in the datasheet if you look hard enough.  I'm actually tempted to put both solutions on the board and do some experimentation.
 

Online David Hess

  • Super Contributor
  • ***
  • Posts: 17428
  • Country: us
  • DavidH
Re: PICs with Op Amps: Non-inverting? Off-piste?
« Reply #9 on: April 01, 2020, 07:54:56 pm »
It's a trade-off.... but one that can only be made once you understand the limitations... As was mentioned above.... CMRR is in the datasheet if you look hard enough.  I'm actually tempted to put both solutions on the board and do some experimentation.

Dual slope integrating analog-to-digital converters which included the input buffer (voltage follower) faced the same problem with low CMRR on a CMOS process albeit with an analog CMOS process so not nearly as bad.  The solution for them was to either require an external buffer, in which case a precision JFET or bipolar operational amplifier could be used, or cleverly do the automatic zero cycle with the buffer common mode input voltage set to the input voltage so the common mode error was included as part of the zero error and removed.  I suspect Intersil got a patent on this to the detriment of competitors like Siliconix and Texas Instruments.

Let's see ... they needed a minimum common mode rejection ratio of ... 86 dB for 4-1/2 digits or 20,000 counts of resolution and that is tough to do on an analog CMOS process even now.  Many early multimeters which used these had linearity problems because of this and inspecting old equipment sometimes reveals that the integrated input buffer was replaced with an expensive precision JFET or low input bias current bipolar operational amplifier.
« Last Edit: April 01, 2020, 07:57:38 pm by David Hess »
 
The following users thanked this post: NivagSwerdna


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf