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

0 Members and 1 Guest are viewing this topic.

Online eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 773
  • 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)
 

Online ebastler

  • Super Contributor
  • ***
  • Posts: 6636
  • 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?
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27130
  • 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

Online tom66

  • Super Contributor
  • ***
  • Posts: 6748
  • 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. 
 

Online eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 773
  • 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)
 

Online ebastler

  • Super Contributor
  • ***
  • Posts: 6636
  • 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

Online eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 773
  • 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)
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3854
  • 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.

Online ebastler

  • Super Contributor
  • ***
  • Posts: 6636
  • 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?
 

Online eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 773
  • 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)
 

Online eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 773
  • 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)
 

Online ebastler

  • Super Contributor
  • ***
  • Posts: 6636
  • 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?
 

Online eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 773
  • 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)
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14611
  • 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.
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9085
  • 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.
 

Online eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 773
  • 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)
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 27130
  • 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: 21791
  • 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!
 

Online eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 773
  • 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: 1535
  • 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: 1535
  • 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: 19735
  • 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
 

Online eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 773
  • 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: 19735
  • 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
 

Online eTobeyTopic starter

  • Frequent Contributor
  • **
  • Posts: 773
  • 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)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf