Author Topic: Will this signal destroy my uC pin?  (Read 2381 times)

0 Members and 1 Guest are viewing this topic.

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Will this signal destroy my uC pin?
« on: May 17, 2024, 03:41:11 pm »
Hi,

my signal generator does some not so pleasent pikes when it is turned off.
I wonder if my inputs (3.3V) will take immediate damage, or if it takes a few of those pulses (10, 100, 600?).

Anyone has some references or knowledge?

"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 6664
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #1 on: May 17, 2024, 03:50:45 pm »
It might help if you tell us what µC you are using...

Also, have you checked the output impedance of that transient voltage pulse? How does it look if you put e.g. a 1 kOhm resistor in parallel?
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 27202
  • Country: nl
    • NCT Developments
Re: Will this signal destroy my uC pin?
« Reply #2 on: May 17, 2024, 03:51:58 pm »
A better approach is to have protection on pins. Even if it is just a prototype board. It saves a lot of trouble and time.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 
The following users thanked this post: SeanB

Offline tom66

  • Super Contributor
  • ***
  • Posts: 6768
  • Country: gb
  • Electronics Hobbyist & FPGA/Embedded Systems EE
Re: Will this signal destroy my uC pin?
« Reply #3 on: May 17, 2024, 04:03:41 pm »
It may well do so.

Likely your signal generator has a 50 ohm output termination.  The damage threshold for the ESD diode in the pin may be around 10mA and the clamping voltage will be Vcc+0.6V typically.  So you can calculate that the current will be approximately (Vout-Vcc+0.6)/50 once over this threshold.   Solving for Vout assuming 10mA maximum and assuming Vcc of 3.3V gives you 4.4V as the absolute maximum voltage that can be output from the signal generator, before its internal termination, before damage occurs. 

Test the signal generator output voltage with no MCU connected on power off and see what voltage it goes to, to determine the maximum open circuit voltage.

Note that the pin might withstand higher currents for a brief period of time, but there is no guarantee of this and progressive damage can occur causing the IO structure to failure.  In many cases, this will cause a dead short from 3.3V to ground, but in some cases it can just damage that IO pin.

Also, note that ADC channels on many microcontrollers will misbehave if just one input is overstressed.  I have a PIC32MM board here where that was a problem, we had to change divider resistors to ensure no channel ever went above Vcc as it caused adjacent channels to misbehave. 
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #4 on: May 17, 2024, 05:41:06 pm »
It might help if you tell us what µC you are using...

Also, have you checked the output impedance of that transient voltage pulse? How does it look if you put e.g. a 1 kOhm resistor in parallel?

Its a STM32G431 RBT6.

With 1k, the max value goes down to 5V.

A better approach is to have protection on pins. Even if it is just a prototype board. It saves a lot of trouble and time.
Of course i have those on my prototype, but right now im testing with a nucleo board. I dont think it has any protection.
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 6664
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #5 on: May 17, 2024, 05:47:33 pm »
With 1k, the max value goes down to 5V.

Umm, "goes down to 5V"? Isn't the maximum about 4.25V in the screenshot you shared?
 
The following users thanked this post: pcprogrammer

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #6 on: May 17, 2024, 05:54:37 pm »
With 1k, the max value goes down to 5V.

Umm, "goes down to 5V"? Isn't the maximum about 4.25V in the screenshot you shared?
Yes, that one is outdated:
I checked the setup without the resistor, the value was at about 5.7V, but it is not always the same.
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3913
  • Country: nl
Re: Will this signal destroy my uC pin?
« Reply #7 on: May 17, 2024, 06:09:52 pm »
Also the so called spikes in that screenshot are clearly topped of by some diode action. The question is how much current is flowing at that moment and for how long if it will actually do damage.

What is the signal generator you are using, and how is it turned off? Is there a switch to turn of the output, or is it actually turning of the whole signal generator that creates these pulses.

Can it be the wiring you are using that introduces inductive properties. So many unknowns here.

If it is just for some simple testing on a test board, looking at the duration of the spikes, I don't think it will hurt, but better safe then sorry and disconnect the generator output before turning it off would be my choice. Probably less chance of damage.

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 6664
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #8 on: May 17, 2024, 06:22:59 pm »
I know from the other thread that you are testing a Siglent SDG1032X. Looks like you turned off the unit's mains power while the output was still active, I assume? If that is the case, I would strongly advise to turn off the output first, then power down the unit.

For what it's worth, my SDG2042X does not output any transient voltages outside of the currently selected signal range -- even when powered off while it is still actively outputting a signal. It might be a better design than its smaller sibling, but this has me wondering: Could it be that some voltage is injected from your device under test? Do you still see that transient if you have only the scope connected to the SDG's output?
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #9 on: May 17, 2024, 07:21:21 pm »
Could it be that some voltage is injected from your device under test? Do you still see that transient if you have only the scope connected to the SDG's output?
I do not subject my DUT to a device, that i do not trust yet.  :-DD

Its just the scope. Nothing else. And some alligator BNC clips.
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #10 on: May 17, 2024, 07:36:28 pm »
I just had another test:
at 2V high level it also peaks at around 5V
But with 1V high level it peaks at around 1.5V

So i guess i have to create a little checklist for powering down everything. Like going through a checklist when landing a plane  ;D.
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 6664
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #11 on: May 17, 2024, 07:59:35 pm »
You did not answer the question from pcprogrammer and me yet: How didi you actually "switch off" in those tests?

Does the spurious voltage already show up when you just disable the generator's output, via the rubber pushbutton? Or does it only occur when you power down the generator? If it's the latter, does it make a difference whether you have first disabled the output?
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #12 on: May 17, 2024, 08:15:08 pm »
I turned off the generator itself.

I would expect it, to make a difference... gonna try...

Edit:
I have not found any problematic issues. (0-2V).
« Last Edit: May 17, 2024, 08:31:36 pm by eTobey »
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14665
  • Country: fr
Re: Will this signal destroy my uC pin?
« Reply #13 on: May 18, 2024, 12:52:15 am »
Some pins of this MCU are 5V-tolerant, some aren't. You need to check which are in the datasheet and whether you use one of them here.
The rated max voltage on 5V-tolerant pins is 5.5V. The absolute max is a bit confusing, I'm not sure what "FT_c" pins are, you'll need to read the datasheet. If the pin you use is a FT_xxx pin but not a FT_c pin (sic), the absolute max is min(VDD, VDDA)+4, so if you typically have VDD = VDDA = 3.3V, that would be 7.3V. Which gives a significant margin. As long as you use the right pin. Which I don't know.

In any case, if the generator is at all able to generate voltages above that, some protection before the input pin is highly recommended. If it's just a dev board, you can add some protection on a small piece of proto board - I suppose you were already using some adapter, you just need to insert protection.
 

Online NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9101
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Will this signal destroy my uC pin?
« Reply #14 on: May 18, 2024, 03:51:47 am »
Add a signal line TVS to clamp the voltage.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #15 on: May 18, 2024, 05:50:19 am »
No, protections (TVS) would not work on the high side. It will distort the signals. I could clamp the negative voltages, though. Also, i run on a breadboard, and dont want to solder anything here, or create more stuff already. I was in the hope of getting information on what a pin can withstand.

Also it is really stupid, to work on a project and then having to create a "little project" to protect the MCU, because i spent a little more money in the hopes, of not having to to this, like you would have, with cheap products.

"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 27202
  • Country: nl
    • NCT Developments
Re: Will this signal destroy my uC pin?
« Reply #16 on: May 18, 2024, 08:43:36 am »
No, protections (TVS) would not work on the high side. It will distort the signals.
A TVS diode doesn't distort signals (TVS diodes are used on all inputs / outputs on any piece of quality equipment). A TVS diode is similar to a zener diode but with better surge handling capacity. Also, never clamp signals to power rails using a diode. You don't want to push power from an unknown source into your power supply.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21842
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Will this signal destroy my uC pin?
« Reply #17 on: May 18, 2024, 01:23:56 pm »
What is the pin? ADC? For what purpose?  What is the source impedance and bandwidth?  (50Ω I guess given the generator, but beyond that?)  What is your input circuit, or your circuit overall?

I was in the hope of getting information on what a pin can withstand.

At least all other STM32s I've looked at, pin characteristics are reasonably well documented in the data section -- give it a look.  You will need the IO pin type/class from the pinout section, then cross-reference that with the allowed pin injection currents, voltage ranges, etc.  Note that analog inputs (or pins near an analog section) typically stipulate zero injected current, else the analog stuff may read incorrectly -- charge injection into the internal circuitry messes everything up, and maybe it reads wrong by some counts, maybe whole bits in any position (or comparators gain offset, or work slower, or flip state, or the PLL messes up, etc.).

Anything that's rated as -0.3 to VCC+0.3V (or 0.5 or 0.6 are sometimes seen on MCUs), can be assumed to have input clamp diodes to the supplies.  5V-tolerant pins may be absolute (-0.3 to 7V, say), or VCC-relative, suggestive of the type of ESD structure used there (i.e. zener to GND, or zener or diode-strapped FET to VCC, etc.).

If current injection is allowed, and doesn't mess up any nearby peripherals, it is safe to rely on that as a feature -- but be careful that only that much current is used, including transiently, and respect totals across IO banks or whole chip.  Mind also that using clamp diodes typically increases Icc, because they're usually actually BJT structures clamping to VCC/GND with the collector to the opposite side, i.e. the pin current is drawn from both rails, not strictly one (as a true diode would do).


A TVS diode doesn't distort signals (TVS diodes are used on all inputs / outputs on any piece of quality equipment). A TVS diode is similar to a zener diode but with better surge handling capacity. Also, never clamp signals to power rails using a diode. You don't want to push power from an unknown source into your power supply.

Well, it certainly does distort some signals.  It wouldn't be a TVS otherwise!

I guess you meant as signals that are intended, nominal range, as opposed to unexpected noise or surge; but those are signals in the general sense as well, so it pays to specify.

Nothing wrong with clamping to supply per se, but one must have a complete list of potential hazards you are protecting against.  For example, clamping ESD into a supply of more than a few uF is fine, almost regardless of load current; but clamping, say, a telecom surge, or a cross-wired input, is a different matter.

Clamp diode arrays often include a supply TVS as well, which can be biased by the signals themselves (TVS left unconnected), or tied with the supply which also provides clamping to the circuit generally.

Clamp diodes are generally acceptable for analog purposes, but the impedance does matter, as well as bandwidth and linearity.  Zener/TVS are less preferable as they have a softer knee and higher capacitance.  Very small clamp diodes (<1pF Cj) are available for broadband applications (e.g. USB3, HDMI, etc.), which would also do well on high impedance and high bandwidth analog signals.

Tim
« Last Edit: May 18, 2024, 01:31:03 pm by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #18 on: May 18, 2024, 01:37:03 pm »
No, protections (TVS) would not work on the high side. It will distort the signals.
A TVS diode doesn't distort signals (TVS diodes are used on all inputs / outputs on any piece of quality equipment). A TVS diode is similar to a zener diode but with better surge handling capacity. Also, never clamp signals to power rails using a diode. You don't want to push power from an unknown source into your power supply.
I have made some test on a zener i have. See picture.

I cant think how a TVS diode would work much better.
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: ua
Re: Will this signal destroy my uC pin?
« Reply #19 on: May 18, 2024, 01:42:29 pm »
A TVS diode doesn't distort signals (TVS diodes are used on all inputs / outputs on any piece of quality equipment).
Of course they do. Not only they have non-zero junction capacitance, just like any diode, but this capacitance can actually be very high, which can be critical for fast signals.

For example, P6KE series:





Input protection is always a trade-off between preservation of the original signal and the level of protection.

Clamping input signal to rails is not necessarily a bad idea, as long as measures are taken to prevent the rail voltages from exceeding the allowed thresholds, which can be done in multiple ways from simple zeners to active shunting circuitry.
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: ua
Re: Will this signal destroy my uC pin?
« Reply #20 on: May 18, 2024, 02:00:30 pm »
Anyway, this advice is to be followed:

A better approach is to have protection on pins. Even if it is just a prototype board. It saves a lot of trouble and time.

Never trust your input signal! Unless, of course, it is generated by a trusted subcircuit inside the device itself -- an external signal generator is not one of them.

I'd suggest building a feed-through signal conditioner that can be used for prototyping as a weekend (or a couple weekends) project: input port, output port, small signal fast diodes, like 1n4448, that clamp input (connected in series with a current limiting resisitor) to rails and something to clamp the rails to an acceptable voltage: from a zener in the simplest case to a transistor-based shunt with a potentiometer to adjust the clamping voltage level.
Not only it can be practically useful, but it's also a good exercise to learn something new, in this case, input protection techniques.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19795
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Will this signal destroy my uC pin?
« Reply #21 on: May 18, 2024, 02:02:24 pm »
No, protections (TVS) would not work on the high side. It will distort the signals.
A TVS diode doesn't distort signals (TVS diodes are used on all inputs / outputs on any piece of quality equipment). A TVS diode is similar to a zener diode but with better surge handling capacity. Also, never clamp signals to power rails using a diode. You don't want to push power from an unknown source into your power supply.
I have made some test on a zener i have. See picture.

Are you sure that's a 4.7V zener? Looks more like a 2.7V zener.

I suggest you do a little research about "load lines" and diode I-V curves. That will enable you to predict the voltage and current through a diode, zener and otherwise. Prediction is always better than measurement, because it requires understanding. Of course measurement should be used to confirm the understanding and operation.

BTW, capacitors diodes and resistors all "distort" the signal. The question is whether that distortion affects operation. Is should be possible to choose a zener, TVS, etc so that the signal is not affected. Whether that will also offer protection depends on the details of the circuit inputs, the protection components, and the stimulus.

But well done for spotting a possible problem, and then asking a question.
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
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #22 on: May 18, 2024, 02:12:29 pm »
Anyway, this advice is to be followed:

A better approach is to have protection on pins. Even if it is just a prototype board. It saves a lot of trouble and time.

Never trust your input signal! Unless, of course, it is generated by a trusted subcircuit inside the device itself -- an external signal generator is not one of them.

I'd suggest building a feed-through signal conditioner that can be used for prototyping as a weekend (or a couple weekends) project: input port, output port, small signal fast diodes, like 1n4448, that clamp input (connected in series with a current limiting resisitor) to rails and something to clamp the rails to an acceptable voltage: from a zener in the simplest case to a transistor-based shunt with a potentiometer to adjust the clamping voltage level.
Not only it can be practically useful, but it's also a good exercise to learn something new, in this case, input protection techniques.
I never thought, that signal generators could be that problemtatic. At leaste those that cost more than 300 bucks.

But yes its a bood thing to not trust everything. And this can be said in quite a lot of occasions, not only electronics!

I have used some BAT46 to clamp signals to the rail, as inputs can only be max to 0.3V. But i dont really know much about what you said.

"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19795
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Will this signal destroy my uC pin?
« Reply #23 on: May 18, 2024, 02:18:04 pm »
I never thought, that signal generators could be that problemtatic. At leaste those that cost more than 300 bucks.

I have no opinion about the specific signal generator you are using, but such issues are one of the reason professionals like HP-A-K kit and are prepared to pay more for it.

You might like to look at your PSU for similar "infelicities".
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
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #24 on: May 18, 2024, 02:28:29 pm »
No, protections (TVS) would not work on the high side. It will distort the signals.
A TVS diode doesn't distort signals (TVS diodes are used on all inputs / outputs on any piece of quality equipment). A TVS diode is similar to a zener diode but with better surge handling capacity. Also, never clamp signals to power rails using a diode. You don't want to push power from an unknown source into your power supply.
I have made some test on a zener i have. See picture.

Are you sure that's a 4.7V zener? Looks more like a 2.7V zener.

I suggest you do a little research about "load lines" and diode I-V curves. That will enable you to predict the voltage and current through a diode, zener and otherwise. Prediction is always better than measurement, because it requires understanding. Of course measurement should be used to confirm the understanding and operation.

BTW, capacitors diodes and resistors all "distort" the signal. The question is whether that distortion affects operation. Is should be possible to choose a zener, TVS, etc so that the signal is not affected. Whether that will also offer protection depends on the details of the circuit inputs, the protection components, and the stimulus.

But well done for spotting a possible problem, and then asking a question.

Its a 4.7V Zener. But i had this 36k resistor in there  ::).

See picture with 100R: The signal is distorted from 4V on, and clamps the voltage to 4.7V
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: ua
Re: Will this signal destroy my uC pin?
« Reply #25 on: May 18, 2024, 02:32:20 pm »
I have used some BAT46 to clamp signals to the rail, as inputs can only be max to 0.3V.
Things to keep in mind when using Schottky diodes for input protection are junction capacitance (pretty low in this case) and reverse leakage current, which in this case is going to be on the order of 0.1..3 uA, which may or may not be an issue, depending on the input and source impedances.

But i dont really know much about what you said.
Well it's a big topic. Take a look at e.g. https://www.digikey.com.au/en/articles/protecting-inputs-in-digital-electronics which covers the basics. What they don't cover in this article is that when you clamp input signal to power rails, then the rails must be able to sink whatever extra current the extra voltage of the input signal is able to source, otherwise your rails voltage may rise above acceptable levels. Short spikes (such as ESD or turn-on/turn off transients, like in your case) can be absorbed by capacitors (which you are supposed to have on power rails anyway). For prolonged input overvoltage you need something that will begin sinking current as the voltage of the power rail raises above a certain level, which can be as simple as a single Zener diode (of the beefier ones, if necessary), or more involved, if you need e.g. higher precision.

Simulate it. This kind of stuff is easy to simulate with little frustration, as it doesn't require any models beyond basic SPICE primitives, except maybe Schottky diodes, but they can be found easily (unlike some ICs, but that's a different story). It requires a bit of learning, but it's a very rewarding experience. In the long run it will save you a lot of time. Remember, though, that simulation has its limits. But adding explicit elements for parasitic inductance, capacitance etc. can make those limits much wider :).
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 27202
  • Country: nl
    • NCT Developments
Re: Will this signal destroy my uC pin?
« Reply #26 on: May 18, 2024, 02:33:21 pm »
A TVS diode doesn't distort signals (TVS diodes are used on all inputs / outputs on any piece of quality equipment).
Of course they do. Not only they have non-zero junction capacitance, just like any diode, but this capacitance can actually be very high, which can be critical for fast signals.
Which is why there are so many different kinds of TVS diodes. Including those intended for high speed signals like USB (in various forms), PCIe, HDMI, etc. You can find these with capacitances way below 1pf.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 6664
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #27 on: May 18, 2024, 02:36:43 pm »
I turned off the generator itself.

I would expect it, to make a difference... gonna try...

Edit:
I have not found any problematic issues. (0-2V).

So what does that mean? If you toggle the output off (via the dedicated rubber button) before powering down the generator, i.e. if you use the generator as intended, you don't have any problems at all? What does the "0-2V" limitation have to do with it, and where did it suddenly come from?  ???

Those troubleshooting discussions with you would be much more productive if you describe in detail what you did and observed, right away, rather than giving little sentence fragments here and there.

Also, please be more systematic in the experiments you do and the way you report results -- e.g. the unexplained transition from 4.25V to 5.7V transients earlier in the thread, and now the "2V" limitation which seems to come out of nowhere.
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: ua
Re: Will this signal destroy my uC pin?
« Reply #28 on: May 18, 2024, 02:38:14 pm »
See picture with 100R: The signal is distorted from 4V on, and clamps the voltage to 4.7V
It's quite hard to understand. Yellow is obviously the post-clamping signal. Green must be the raw input? What's the vertical offset and scale? It's really hard to tell that yellow is distorted -- it looks good to me. The two traces must be aligned and have the same vertical scale to draw any conclusions.

What are the noisy-looking white traces? Are they relevant at all? If they aren't, they should be removed to avoid confusion.

If you want your data to be understood, you need to prepare its visualisation appropriately, otherwise you will have a hard time delivering your point.
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: ua
Re: Will this signal destroy my uC pin?
« Reply #29 on: May 18, 2024, 02:50:23 pm »
Which is why there are so many different kinds of TVS diodes. Including those intended for high speed signals like USB (in various forms), PCIe, HDMI, etc. You can find these with capacitances way below 1pf.
Yes of course.

My point was that saying that a TVS diode doesn't distort signal without a further clarification may be misleading. It's important to explain that care must be taken to select parts that: a) have sufficiently low capacitance so as not to cause an unacceptable distortion of the input signal; b) have a sufficient surge capability so as to provide protection against the required level and duration of overvoltage.

Depending on the numbers, it may be impossible to find a single TVS diode that meets both requirements. That's when other protection techniques come into play.
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #30 on: May 18, 2024, 02:50:27 pm »
Well it's a big topic. Take a look at ....

That is one good article, i already read twice. But i did not really understand what you were saying, where the energy would go after the diode. In my case with the breadboard, i do not have a proper rail, nor do i want to solder anything on there. And long wires wouldnt be that good either would they (25cm)?

Can i clamp the volatage with a shottkey to a zener, that "simulatates" a rail?
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: ua
Re: Will this signal destroy my uC pin?
« Reply #31 on: May 18, 2024, 02:52:40 pm »
That is one good article, i already read twice. But i did not really understand what you were saying, where the energy would go after the diode. In my case with the breadboard, i do not have a proper rail, nor do i want to solder anything on there. And long wires wouldnt be that good either would they (25cm)?

Can i clamp the volatage with a shottkey to a zener, that "simulatates" a rail?
The answer is "maybe". Hard to tell without a schematic that shows input, protection, output, and power rails (including ground).
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #32 on: May 18, 2024, 02:58:03 pm »
So what does that mean? If you toggle the output off (via the dedicated rubber button) before powering down the generator, i.e. if you use the generator as intended, you don't have any problems at all? What does the "0-2V" limitation have to do with it, and where did it suddenly come from?  ???

Those troubleshooting discussions with you would be much more productive if you describe in detail what you did and observed, right away, rather than giving little sentence fragments here and there.

Also, please be more systematic in the experiments you do and the way you report results -- e.g. the unexplained transition from 4.25V to 5.7V transients earlier in the thread, and now the "2V" limitation which seems to come out of nowhere.
Im sorry.

I encountered these problems only when turning off the gen, so far. At a squarewave from 0-2V, the level did not go up anywhere near 5V.

It was just some more detail, that i wanted to add.
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 6664
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #33 on: May 18, 2024, 03:11:49 pm »
I encountered these problems only when turning off the gen, so far.

But did you encounter the transients at all when you first turn off the output, then turn off the power to the generator? I am getting a bit desparate that you still have not answered this simple question.

If turning off the output first fixes the problem, that would be such an obvious and adequate solution. Before I shut off my car engine, I stop my car and put the gears into idle or step on the clutch pedal. I am not complaining that the car does not handle it well if I shut off the ignition while driving...
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19795
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Will this signal destroy my uC pin?
« Reply #34 on: May 18, 2024, 03:26:58 pm »
I encountered these problems only when turning off the gen, so far.

But did you encounter the transients at all when you first turn off the output, then turn off the power to the generator? I am getting a bit desparate that you still have not answered this simple question.

If turning off the output first fixes the problem, that would be such an obvious and adequate solution. Before I shut off my car engine, I stop my car and put the gears into idle or step on the clutch pedal. I am not complaining that the car does not handle it well if I shut off the ignition while driving...

Power cuts happen. I had a (VW) car where the engine suddenly cut out while I was going round a busy roundabout. Fortunately it was a manual transmission, so there was only inconvenience until the hall-effect sensor had been replaced. Analogies are always dangerous.

But I agree, there is the smell of the XY problem about this thread. The OP might benefit from reading the first three paragraphs at https://entertaininghacks.wordpress.com/library-2/good-questions-pique-our-interest-and-dont-waste-our-time-2/
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
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 27202
  • Country: nl
    • NCT Developments
Re: Will this signal destroy my uC pin?
« Reply #35 on: May 18, 2024, 03:47:58 pm »
I encountered these problems only when turning off the gen, so far.

But did you encounter the transients at all when you first turn off the output, then turn off the power to the generator? I am getting a bit desparate that you still have not answered this simple question.

If turning off the output first fixes the problem, that would be such an obvious and adequate solution. Before I shut off my car engine, I stop my car and put the gears into idle or step on the clutch pedal. I am not complaining that the car does not handle it well if I shut off the ignition while driving...

Power cuts happen.
Indeed. Test equipment which supply power and/or signals to a DUT should be designed so they don't output spikes / surges when powered down for whatever reason.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline temperance

  • Frequent Contributor
  • **
  • Posts: 517
  • Country: 00
Re: Will this signal destroy my uC pin?
« Reply #36 on: May 18, 2024, 04:02:41 pm »
Quote
Indeed. Test equipment which supply power and/or signals to a DUT should be designed so they don't output spikes / surges when powered down for whatever reason.

For those wondering what is going on:
https://www.eevblog.com/forum/testgear/siglent-sdg1032-as-bad-as-rigol-dg812/msg5505595/#msg5505595

Maybe this topic should be closed or removed.
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #37 on: May 18, 2024, 04:43:13 pm »
I encountered these problems only when turning off the gen, so far.

But did you encounter the transients at all when you first turn off the output, then turn off the power to the generator? I am getting a bit desparate that you still have not answered this simple question.

If turning off the output first fixes the problem, that would be such an obvious and adequate solution. Before I shut off my car engine, I stop my car and put the gears into idle or step on the clutch pedal. I am not complaining that the car does not handle it well if I shut off the ignition while driving...

Power cuts happen.
Indeed. Test equipment which supply power and/or signals to a DUT should be designed so they don't output spikes / surges when powered down for whatever reason.

I do agree. Moreover, i would say, that there should be safe limits to setup, that would not be exceeded, when misconfiguring it.
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19795
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Will this signal destroy my uC pin?
« Reply #38 on: May 18, 2024, 06:10:07 pm »
I encountered these problems only when turning off the gen, so far.

But did you encounter the transients at all when you first turn off the output, then turn off the power to the generator? I am getting a bit desparate that you still have not answered this simple question.

If turning off the output first fixes the problem, that would be such an obvious and adequate solution. Before I shut off my car engine, I stop my car and put the gears into idle or step on the clutch pedal. I am not complaining that the car does not handle it well if I shut off the ignition while driving...

Power cuts happen.
Indeed. Test equipment which supply power and/or signals to a DUT should be designed so they don't output spikes / surges when powered down for whatever reason.

I do agree. Moreover, i would say, that there should be safe limits to setup, that would not be exceeded, when misconfiguring it.

You do set limits: the max voltage and max current.

If you want to have a second set of limits, then you will have to define why you won't  misconfigure those limits.

Then you'll have to work out why a PSU would violate the first set of limits but not the second.
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
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #39 on: May 19, 2024, 09:55:39 am »
Made another test with a 50 Ohm termination ( gen -> 50 Ohm term -> probe).
It peaks at 6.2V with a set up level of 3.3! And it equals a mean of 4.5V for 240us.

Squarewave on high level that is.
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Offline EPAIII

  • Super Contributor
  • ***
  • Posts: 1093
  • Country: us
Re: Will this signal destroy my uC pin?
« Reply #40 on: May 19, 2024, 01:03:32 pm »
Pikes?

https://en.wikipedia.org/wiki/Pike_(weapon)

Yes, I would think a pike would definitely destroy any micro-processor pin that I know of. In fact, it would probably destroy the entire micro-processor.

But so would a sword, a saber, a lance, etc.



Sorry, but I have had German friends who made fun of mein Deutsch.



Hi,

my signal generator does some not so pleasent pikes when it is turned off.
I wonder if my inputs (3.3V) will take immediate damage, or if it takes a few of those pulses (10, 100, 600?).

Anyone has some references or knowledge?
Paul A.  -   SE Texas
And if you look REAL close at an analog signal,
You will find that it has discrete steps.
 

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 6664
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #41 on: May 19, 2024, 01:25:14 pm »
Pikes?
https://en.wikipedia.org/wiki/Pike_(weapon)

No no, you got that wrong. What us Germans are really concerned about is the damage wrought to electronc circuits by fish, especially the predatory species.  ::)

Or maybe it was just a typo for "spike", which could actually happen to a native speaker too. I certainly produce plenty of them in German...
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7864
  • Country: de
  • A qualified hobbyist ;)
Re: Will this signal destroy my uC pin?
« Reply #42 on: May 19, 2024, 02:26:18 pm »
A TVS diode doesn't distort signals (TVS diodes are used on all inputs / outputs on any piece of quality equipment).
Of course they do. Not only they have non-zero junction capacitance, just like any diode, but this capacitance can actually be very high, which can be critical for fast signals.
Which is why there are so many different kinds of TVS diodes. Including those intended for high speed signals like USB (in various forms), PCIe, HDMI, etc. You can find these with capacitances way below 1pf.

A classic method to hide the relative large capacitance of a TVS is to place it in a diode bridge. Surge protectors for DSL or GigE often use this method (together with GDTs). For low power transients you can get that integrated in a chip, e.g. SRV05-4.
 
The following users thanked this post: shapirus

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #43 on: May 19, 2024, 07:41:40 pm »
I was thinking about a circuit, and this is what i ended up with.

Is there a way to get rid of the 3.3V ? Without it, the signal is greatly distorted from just over 2V on.
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #44 on: May 21, 2024, 11:03:18 am »
I have now put a 10uF capacitor as DUT, and the line is terminated with a 50Ohm resistor.

Its not really smoothed out. I guess then it could really do some harm?
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7864
  • Country: de
  • A qualified hobbyist ;)
Re: Will this signal destroy my uC pin?
« Reply #45 on: May 21, 2024, 02:04:32 pm »
I was thinking about a circuit, and this is what i ended up with.

Is there a way to get rid of the 3.3V ? Without it, the signal is greatly distorted from just over 2V on.

Try a Zener rated for a higher voltage or five silicon diodes in series.
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #46 on: May 21, 2024, 08:23:33 pm »
Try a Zener rated for a higher voltage or five silicon diodes in series.

But then i probably exceed the upper limit. They dont have such a sharp knee.

Im thinking about putting in a 3.3V regulator without a zener, if there wouldnt be a better way.
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: ua
Re: Will this signal destroy my uC pin?
« Reply #47 on: May 21, 2024, 09:21:59 pm »
Im thinking about putting in a 3.3V regulator without a zener, if there wouldnt be a better way.
Not sure how exactly you're going to use it. In series with input signal?

I don't know if it's possible to design a precise clamper that won't distort the signal and would not require some supply voltage itself and, if it has to be really precise, some op amp based tricks. Several fast diodes in series connected from signal (after a current limiting resistor) to ground is probably as good as you can get.

How precise do you need it to be, anyway? You never answered the questions in post #17, answers to which will define the required precision: is the target input pin digital or analog? What bandwidth or timing tolerance is required?

Options can vary from a simple current limiting resistor in series with input signal and letting the input pin protection diodes handle the rest (if they exist there, of course) to some quite elaborate circuits.
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #48 on: May 22, 2024, 05:10:29 am »
Im thinking about putting in a 3.3V regulator without a zener, if there wouldnt be a better way.
Not sure how exactly you're going to use it. In series with input signal?

How precise do you need it to be, anyway? You never answered the questions in post #17, answers to which will define the required precision: is the target input pin digital or analog? What bandwidth or timing tolerance is required?


I put it in  place of the zener. See above the picture with the circuit.

I have not answered, because i have no numbers yet. At least i want it not look so bad on the scope. It looks horrible with that zener alone.
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7864
  • Country: de
  • A qualified hobbyist ;)
Re: Will this signal destroy my uC pin?
« Reply #49 on: May 22, 2024, 12:10:31 pm »
Anyway, the 1 kOhm series resistor limits the current also for the microcontroller's clamping diodes. So the Zener diode can be for a higher voltage. Alternatively you could use a level shifter as a protective buffer in case of a digital signal.
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: ua
Re: Will this signal destroy my uC pin?
« Reply #50 on: May 22, 2024, 02:29:03 pm »
I have not answered, because i have no numbers yet. At least i want it not look so bad on the scope. It looks horrible with that zener alone.
Okay, as a starting point, will this be good enough?

Input: a 100 kHz triangle wave coming from a sig gen with 50 Ohms output impedance.

Traces: yellow is input signal before clamper, cyan is after it passes the clamper.
Math: yellow - cyan.
Probing: 10x oscilloscope probes, alligator clamp ground leads.
Assembly: solderless breadboard.

Peak voltage measurements are shown in the side window on the right.

1. 20 Vpp 0 V DC bias input:




2. 10 Vpp 0 V DC bias input:




3. 3.3 Vpp, +1.65 V DC bias input (so the signal is contained within the positive and negative clamping thresholds):




Schematic:





This is an illustration of the idea that I mentioned earlier, that is, to use fast diodes to clamp the input signal to power rails created specifically for such clamping.

The rails must be capable of sinking (positive) and sourcing (negative) enough current. The former is limited by DZ1, the latter is limited by R1 (decreasing R1 increases the negative clamping capability).

The voltage levels of such rails is chosen as Vr = Vc - Vf for the positive rail and Vr = Vc + Vf for the negative rail, where Vc is the desired clamping level and Vf is the forward voltage drop of the clamping diode(s).

In my example clamping starts at just about 3.3V and reaches almost 3.6V at +10V input, which is a bit too high: it's better to set the voltage of the positive clamping rail a bit lower.

Dependence of Vf on the current that's flowing through the diode determines how far from flat the clamped signal voltage will be. The higher the current, the higher the Vf. In other words, there is a certain voltage range in which the input signal is already distorted, but not yet fully clamped, and that is seen on the oscillograms as the output trace being non-flat where the input signal exceeds the clamping thresholds.

D1 and DZ1 are used in my example as a primitive way to set the clamping rail voltages. This is not power-efficient: a less wasteful way, where it is important, would be to use linear regulators or voltage follower op amps. Besides, as DZ1 starts to sink more clamped current, the voltage drop across it increases, thus further spoiling the flatness characteristic of the positive clamper. A beefy cap across the zener will help with that if the overload condition isn't lasting long.

Of course, this simulates pretty well, save for the effects of parasitic inductance and capacitance, which manifest themselves in hardware as phase shift and degradation of high frequency content between input and output.
« Last Edit: May 22, 2024, 02:34:40 pm by shapirus »
 

Offline eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: de
Re: Will this signal destroy my uC pin?
« Reply #51 on: May 22, 2024, 05:45:11 pm »
Okay, as a starting point, will this be good enough?

Yes it looks good, but thats with a rail, and i was wondering if it could be achieved without a rail.

I have something like this in my mind, what do you think about that? (see picture)
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
 

Online shapirus

  • Super Contributor
  • ***
  • Posts: 1570
  • Country: ua
Re: Will this signal destroy my uC pin?
« Reply #52 on: May 22, 2024, 07:02:40 pm »
I have something like this in my mind, what do you think about that? (see picture)
No it won't be clamping efficiently enough and it will distort your signal.

I strongly suggest that you learn how to run simulations (e.g. kicad+ngspice). It will remove a lot of guesswork and let you try various ideas.
 
The following users thanked this post: nctnico


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf