1
\$\begingroup\$

According to the data sheet, the maximum absolute voltage on a GPIO pin is -0.3 and +4V, respectively and a max of 20mA source/sink. I am trying to understand where these requirements come from and to which extent they apply to my use case:

schematic

simulate this circuit – Schematic created using CircuitLab

In this case, if either switch (not both at the same time!) is closed, the maximum current that can flow from/into the GPIO pin is 20/2000=10mA, so within spec.

For the voltage at node "IN" it depends on the resistance looking into the pin. Let's assume this pin drives something, this resistance should be low. But if it's high impedance (e.g. ADC pin), then technically there are +/-20V on this pin. But to which extent can this even be a problem if no current flows?

My understanding is that the IO's still have ESD diodes which clamp high over-voltages. These are thousands of volts but they are a transient (very short) events. What makes the IC susceptible to damage is the current that flows and results in thermal damage. Connecting a 1000V source directly would definitely damage the IC because a large current would flow for long time (heating up junction etc).

But if I add a current limiting resistor to ensure that the maximum current is always below 20mA, I am wondering if the voltage can technically exceed the max absolute ratings under certain conditions.

I know that a Zener diode is the common way to protect a pin. But I am looking for a solution that only uses a resistor (if possible).

Can I connect +/-20V via a 2k resistor to a STM32G GPIO pin?

If not, what is the reason (i.e., the exact damage mechanism)?

If the answer is different depending on the scenario, let's consider the cases (a) device can still operate normally (b) device does not operate normally but does not get permanently damaged (c) device might get permanently damaged

\$\endgroup\$
1
  • \$\begingroup\$ @Justme 's answer is the by-the-book reason as to why you should not "push" this limitation, it is a threshold for damage only. The damage mechanism from injection current is usually the destruction of an overvoltage protection diode. Where these are not present, e.g. for a high-v tolerant pin as mentioned, a MOSFET gate will be destroyed. Injection current will also severely affect the reset characteristics of a device, since the injection current "powers" the device when normal power is removed. \$\endgroup\$ Commented Mar 28, 2023 at 23:45

2 Answers 2

1
\$\begingroup\$

The injection current tolerated while the MCU still works properly may be 5mA or even 0mA.

Some pins don't even have clamping diodes because they are 5V tolerant.

The absolute maximum limit means a limit of permanent damage, it does not mean the MCU will still work normally if you apply voltages and currents right up to absolute maximum ratings.

So no, you can't connect +/- 20V to MCU pin via 2k resistor. It does not have to do anything useful with it, or even work properly for any purpose you might expect. It just might not get permanently damaged, but there is no point in trying if it does damage.

\$\endgroup\$
0
\$\begingroup\$

How could you be sure that there are diode clamps on the pin?

Secondly, even if diode clamps exist, it is not a good idea to inject current into the supply because the regulator providing the supply voltage may not be able to sink the current injected to regulate the supply (regulators may be designed to only source current). In that case, the supply could shoot up and damage the IC.

\$\endgroup\$
4
  • \$\begingroup\$ I am not sure if you understand the question, this is not about supply but a normal GPIO pin. And then, what the reason (=exact damage mechanism) is. \$\endgroup\$
    – divB
    Commented Mar 28, 2023 at 23:28
  • \$\begingroup\$ Regarding diode clamps: Because they are in the data sheet (st.com/resource/en/datasheet/stm32g030j6.pdf). Also, IC's pretty much always have diode clamps for ESD protection. \$\endgroup\$
    – divB
    Commented Mar 28, 2023 at 23:29
  • \$\begingroup\$ @divB, I do understand the question. You are assuming that supply is steady even if you inject current into it but, what if supply starts increasing? Then, still the GPIO voltage will be clamped to supply but supply and hence GPIO voltage can rise beyond absolute max. \$\endgroup\$
    – sai
    Commented Mar 29, 2023 at 1:34
  • \$\begingroup\$ @divB, I could not find in the datasheet any info on the ESD diodes. Hence I asked. Can you point the section where it is? All ICs do not have diode clamps, particularly the 5V tolerant IOs. This IC has 5V tolerant ones and hence I have a stronger feeling that it does not have ESD diodes to supply. \$\endgroup\$
    – sai
    Commented Mar 29, 2023 at 1:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.