PICs with Op Amps: Non-inverting? Off-piste? - Page 1
Forum section: electronics / projects

author: NivagSwerdna
author_rank: Super Contributor
timestamp: March 30, 2020, 09:22:57 am
content: 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 a10.22 ohm sense resistor and then ax10x100 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?

author: fourtytwo42
author_rank: Super Contributor
timestamp: March 30, 2020, 09:28:37 am
content: 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.

author: David Hess
author_rank: Super Contributor
timestamp: March 31, 2020, 01:47:12 am
content: 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.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: March 31, 2020, 10:15:55 am
content: Quote from: David Hess on March 31, 2020, 01:47:12 amThat's really interesting.CM40 VCMR Common-Mode Input Voltage Range AVSS — AVDD VCM41 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!

author: Zero999
author_rank: Super Contributor
timestamp: March 31, 2020, 01:51:50 pm
content: 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/

author: NivagSwerdna
author_rank: Super Contributor
timestamp: March 31, 2020, 03:18:56 pm
content: I'm tempted to just put a INA180B3 into the design

author: David Hess
author_rank: Super Contributor
timestamp: March 31, 2020, 05:36:50 pm
content: Quote from: NivagSwerdna on March 31, 2020, 10:15:55 amThat 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.

author: fourtytwo42
author_rank: Super Contributor
timestamp: March 31, 2020, 07:04:39 pm
content: 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.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: March 31, 2020, 09:08:03 pm
content: Quote from: fourtytwo42 on March 31, 2020, 07:04:39 pmIt'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.

author: David Hess
author_rank: Super Contributor
timestamp: April 01, 2020, 07:54:56 pm
content: Quote from: NivagSwerdna on March 31, 2020, 09:08:03 pmDual 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.