Author Topic: Opamp inputting to microcontroller  (Read 4665 times)

0 Members and 1 Guest are viewing this topic.

Offline ArdWar

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: sc
Re: Opamp inputting to microcontroller
« Reply #25 on: September 06, 2023, 03:48:45 pm »
I had a close look at the schematic in post #7. All indicates that the opamp's output should always be in the range of 0V to 2.4V.
It will be +19V before the -3.3V rail comes up ;)

Actually, about +4V >:D

Just put a diode to clamp Vee smh.
 
The following users thanked this post: Faringdon

Offline xavier60

  • Super Contributor
  • ***
  • Posts: 2917
  • Country: au
Re: Opamp inputting to microcontroller
« Reply #26 on: September 06, 2023, 05:19:52 pm »
Not sure if I'm on the right track here.
First, I thought that putting a diode across the -3.3V would fix it but the common mode input range would still be violated.
If the VAS stage loses drive, output goes high.
HP 54645A dso, Fluke 87V dmm,  Agilent U8002A psu,  FY6600 function gen,  Brymen BM857S, HAKKO FM-204, New! HAKKO FX-971.
 
The following users thanked this post: Faringdon

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7426
  • Country: ca
Re: Opamp inputting to microcontroller
« Reply #27 on: September 06, 2023, 05:24:42 pm »
Does the TL084 have the same big problem as the TL074? That is the phase-inversion and wonky gain when the common-mode voltage is low, near the -ve rail.
If so I would expect a MCU +ve wallop on power up. Treez, have you ever tried using a breadboard?

I curse TI for blending in the _H "upgraded" parts and butchering old datasheets, stripping them of anything too stressful for their lazy literature dept.


Second, RTFM:
"Injecting a negative current on any analog input pins should be avoided as this significantly reduces the accuracy of the conversion being performed on another analog input. It is recommended to add a Schottky diode (pin to ground) to standard analog pins which may potentially inject negative current."
"Any positive injection current within the limits specified for IINJ(PIN) and sum INJ(PIN) in Section 5.3.12 does not affect the ADC accuracy."  {is 5mA}
 
The following users thanked this post: Faringdon

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 20532
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Opamp inputting to microcontroller
« Reply #28 on: September 06, 2023, 05:34:22 pm »
...
Treez, have you ever tried using a breadboard?
...
Second, RTFM:
...

This is Standard Operating Procedure for treez/ocset/faringdon.

The only hope for preventing it is if the second poster to any of his threads warns people to look at who the OP is. With luck that will dissuade people from engaging with his asinine topics, and with luck that will starve him of attention.

For sensible first posts, there would be no need for that. He has started some reasonable threads, but also far too many asinine threads.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: Faringdon

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7426
  • Country: ca
Re: Opamp inputting to microcontroller
« Reply #29 on: September 06, 2023, 06:27:28 pm »
Imagine pissing off the Internet.
I find no treeze thread is reasonable. He withholds details of the application, gives us an LTSpice pseudo-schematic, a long story that can include feelings, then in the thread argues why ____ must follow his beliefs "yes but customer says", "yes but we have no room", "as we all know", then he disappears.

At the end, there is no decision, no fix, no conclusion, no closure - just an abandoned thread and hundreds of them. #5 EEVblog new thread starter (554). I'm only in it for the thanks.

It must look like Burning Man Festival right now, garbage and mud everywhere  :-DD
 
The following users thanked this post: Kean, tooki, Faringdon

Offline magic

  • Super Contributor
  • ***
  • Posts: 7181
  • Country: pl
Re: Opamp inputting to microcontroller
« Reply #30 on: September 06, 2023, 06:34:18 pm »
Does the TL084 have the same big problem as the TL074? That is the phase-inversion and wonky gain when the common-mode voltage is low, near the -ve rail.
Bingo ;D
TL08x and TL07x are more or less the same thing, rumor has it that there used to be some difference in noise specs in a distant past, but I'm not even sure if I have ever seen those datasheets.

Besides, I don't think I would necessarily trust any random opamp, TL072 or not, not to do some questionable things during turn-on, before it reaches minimum voltage for guaranteed proper operation.

Another potential concern is "fail-safety" - if something in the analog stuff goes wrong, do you really want to replace the MCU as well?
(This of course is not applicable to modern consumer products :P)
 
The following users thanked this post: Faringdon

Offline FaringdonTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 2124
  • Country: gb
Re: Opamp inputting to microcontroller
« Reply #31 on: September 06, 2023, 06:38:40 pm »
OK thanks....the attached sim is nearer what we are doing with the circuit........in the attached LTspice sim, after a few ms, the 20V rail goes down as the product is switched OFF......but the neg_3V3 rail stays about neg_3v3...its at this point where the big injection of current goes through the ADC pin 's ESD diodes....because the opamp output goes negative.

I think this is the danger point of the circuit...would you agree?..

..so in other words, the danger only happens when the product gets switched off...so its not actually a problem...would you agree?....the current is limited by the opamps current clamped output....and so the ESD diodes in the micro ADC pin will likely be able to handle this one-off surge?

[i must confess, i never encountered this before, as i always put a series resistor there...but this board has already been done and there's no room for the eight series resistors that would need adding......the whole board would have to be totally ripped up and started over. (a  consultancy actually sent us this as they are overloaded at the mo)]
« Last Edit: September 06, 2023, 06:56:50 pm by Faringdon »
'Perfection' is the enemy of 'perfectly satisfactory'
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7426
  • Country: ca
Re: Opamp inputting to microcontroller
« Reply #32 on: September 06, 2023, 06:42:49 pm »
It's on power up I think. +20V comes up first, the -3.3V comes up late which causes the op-amp to misbehave.

P.S. - oh the "we have no room" thing? This is already in production? All that smoke
 
The following users thanked this post: Faringdon

Offline magic

  • Super Contributor
  • ***
  • Posts: 7181
  • Country: pl
Re: Opamp inputting to microcontroller
« Reply #33 on: September 06, 2023, 06:50:08 pm »
The converse is also possible.
If you remove the positive rail but keep the negative (due to charge stored in all those caps along the way) the opamp will work with -3.3V/0V rails.
If it can't swing to the top rail, it may end up pulling the output below ground.

Although I think TL084 may actually be OK, because as long as IN+ is above VCC or above IN-, the VAS will be cut off and the output PNP will lack base drive.
There is also 64+128Ω in series with the output, for what it's worth ::)

Lastly, with merely 3.3V across the rails, I'm not even sure if TL084 will bias up and do anything at all.

Somewhere here there is a lesson not to relay on SPICE, and certainly not on models of unrelated parts, when contemplating operation outside specification ;)
« Last Edit: September 06, 2023, 06:57:02 pm by magic »
 
The following users thanked this post: Faringdon

Offline FaringdonTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 2124
  • Country: gb
Re: Opamp inputting to microcontroller
« Reply #34 on: September 06, 2023, 07:00:19 pm »
Quote
There is also 64+128Ω in series with the output, for what it's worth
Thanks, do  you mean the ADC pin's  internal input resistance?
'Perfection' is the enemy of 'perfectly satisfactory'
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 7426
  • Country: ca
Re: Opamp inputting to microcontroller
« Reply #35 on: September 06, 2023, 07:41:32 pm »
This is a bad design with no easy or economical fix. Investors will hold on to a money losing stock, it's called "hope mode".
I would say you are pooched.
Testing failed, field trials failed to flush out this H/W error.
There are 8 analog channels configured like this, and no room to add 8 resistors, you say. The rework labour costs would be too high.
Even with a well behaved op-amp, no guarantee the analog input signals stay in range.
The auto-destruct feature must be damaging MCU's. Too costly to repair.

Just throw the boards in the garbage and bite the bullet. Otherwise, what you are you hoping for?
 
The following users thanked this post: Faringdon

Offline Gyro

  • Super Contributor
  • ***
  • Posts: 9921
  • Country: gb
Re: Opamp inputting to microcontroller
« Reply #36 on: September 06, 2023, 08:36:31 pm »
..so in other words, the danger only happens when the product gets switched off...so its not actually a problem...would you agree?....the current is limited by the opamps current clamped output....and so the ESD diodes in the micro ADC pin will likely be able to handle this one-off surge?

Oh, I don't know what everyone was getting worked up about then. I mean, what are the chances of someone switching it off?  There's a special exemption for exceeding the Absolute Maximum ratings while somebody is switching things off, I'm sure I read it somewhere!
Best Regards, Chris
 
The following users thanked this post: Faringdon

Offline magic

  • Super Contributor
  • ***
  • Posts: 7181
  • Country: pl
Re: Opamp inputting to microcontroller
« Reply #37 on: September 06, 2023, 08:40:26 pm »
The real question:
will it fail before warranty ends?
 
The following users thanked this post: Faringdon

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 20532
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Opamp inputting to microcontroller
« Reply #38 on: September 06, 2023, 10:38:43 pm »
The real question:
will it fail before warranty ends?

Will it fail before a contractor gets their fees?I
Will it fail before an employee is paid their salary and outstanding expenses.
Will it fail before trees can land the blame on someone else or another country?
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: Faringdon

Offline dmills

  • Super Contributor
  • ***
  • Posts: 2093
  • Country: gb
Re: Opamp inputting to microcontroller
« Reply #39 on: September 07, 2023, 12:35:13 pm »
I used to think contractors got to be contractors by being the best of the best, then I worked with a few...

They move companies every six months or so for a REASON, it takes that long for the incompetence to surface, and by then they are gone leaving a cloud of burning silicon and cursing behind themselves.

I have some names in my little black book, oh yes.
 
The following users thanked this post: Faringdon

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 20532
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Opamp inputting to microcontroller
« Reply #40 on: September 07, 2023, 01:55:49 pm »
I used to think contractors got to be contractors by being the best of the best, then I worked with a few...

They move companies every six months or so for a REASON, it takes that long for the incompetence to surface, and by then they are gone leaving a cloud of burning silicon and cursing behind themselves.

I have some names in my little black book, oh yes.

I think it depends on the speciality and age.  I've worked with very competent middle-aged RF engineers. There skill takes a long time to accumulate.

Typical software weenies, OTOH, base their behaviour on HR droids that think old=> bad, new => better, and experience => pointing out fundamental flaws.

There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: Faringdon

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19904
  • Country: gb
  • 0999
Re: Opamp inputting to microcontroller
« Reply #41 on: September 07, 2023, 05:16:34 pm »
In first place: Why do you power the op-amp at +20v/-3v when it's going to feed a 3.3V device?
Why not just power it with 3.3V?
If the issue is reaching GND or VDD, use a rail-to-rail amp.
It this actually trolling? Feels like it.
There's no such thing as a rail-to-rail op-amp. The output never really swings from rail-to-rail and the input circuitry uses various hacks to switch between the positive and negative ends of the common mode range, which can introduce distortion.

If I had +20V & -3V available and I wanted to connect it to a device powered from 0V and 3.3V, I would consider adding limiting diodes and a resistor to the output first, before resorting to a rail-to-rail op-amp.
Quote
There is also 64+128Ω in series with the output, for what it's worth
Thanks, do  you mean the ADC pin's  internal input resistance?
Look at the internal schematic of the TL072.
 
The following users thanked this post: Faringdon


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf