As you can see on the attached picture from a reference manual of STM32F7, GPIO pins have internal clamping diodes to protect from overvoltage.

  1. But what maximum voltage can I put into the pin? I know that 5V is max, and 4V is max for VDD. But what would happen if I put, let's say, 10V into the pin? Shouldn't the diodes clamp this overvoltage?

  2. What parameter of a diode decides how many Volts can be clamped safely?

  3. If I want to use external clamping diodes, let's say 1N4148, then what will be maximum voltage that I can put into the pin?


The answer to "Shouldn't the diodes clamp this overvoltage?" is yes and no. It really depends on the output impedance of whatever is feeding it and the strength of the power rail.

If you happened to connect that pin to a 10V power supply, what do you think is going to happen? Will the diode pull down the 10V supply, or will Vdd be pulled up to 10V minus a diode drop. Or will the diode just burn out.

It really all depends on the rest of the circuitry. But as crude as that example is, you can perhaps grasp the idea that the diode has a limit on how far it can go in the role of signal clamping.

The pins ALSO have a current limit. The diode will only survive as long as you do not exceed that current limit.

Will adding an external diode help?

Sometimes the internal clamping diode is not actually a diode but an FET type circuit. An external diode that clamps at less than the internal protection voltage will allow you to dump more current.

If you can't find a diode that clamps to less than the internal circuit, then there is no point. The chip may fry before your diode ever really kicks in.

You still can't short to the other rail though.

In summary, when attaching non-device level signals care needs to be taken to ensure the source impedance is high enough to not over-rate the device and not swamp the rail you are clamping to. Adding an appropriately sized series resistance is generally required.

Addendum: The input protection diodes are really there for "just in case" protection. They should not normally be relied upon to be a functional part of your design. Proper signal preparation before injection into the pin is the better design method.

Generally I prefer this approach.

R1 needs to be chosen to limit the current to the zeners specified reverse current at the indicated zener voltage. That is, the Zener may be rated at say \$3.1V @ 5mA\$.

So \$R1 = (V_{signal} - V_{zener}) / I_{zener}\$


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ Then how about using external bidirectional TVS diode, for example SMCJ5.0CA which has a reverse stand-off voltage of 5V? And of course current-limiting resistors, like 10K. \$\endgroup\$ – zupazt3 Apr 1 '17 at 17:31
  • \$\begingroup\$ @zupazt3, yes that is quite typical. As long as you do the math right. \$\endgroup\$ – Trevor_G Apr 1 '17 at 17:32
  • 1
    \$\begingroup\$ But can TVS be used to constant protection? I mean, what if I not only want to protect my MCU from overvoltage, but I also enable GPIO to operate with those 10V? Can I put constant 10V signal to MCU pin and TVS will drop it? Current will be limited by resistor. \$\endgroup\$ – zupazt3 Apr 1 '17 at 21:03
  • \$\begingroup\$ @zupazt3 no not a tvs. Using the correct resistor in series and a zener is my preferred approach, as shown in my update. Though others may say a resistor then a germanium diode to the rail is better. \$\endgroup\$ – Trevor_G Apr 2 '17 at 2:01
  • \$\begingroup\$ Can you add something to your answer about how to choose R1? \$\endgroup\$ – Peter Mortensen Apr 11 '17 at 10:50

Shouldn't the diodes clamp this overvoltage?

Yes, until it is shot by over-current.

2) What parameter of a diode decides how many volts can be clamped safely?

The maximum current rating, typically not provided. But I would be worried if there is more than 20 mA going through those diodes and typically design for 1 mA.

3) If I want to use external clamping diodes, let's say 1N4148, then what will be maximum voltage that I can put into the pin?

It depends on the design. If you just use two clamping diodes (i.e. they are parallel to the on-die clamping diodes), it depends on which of them kicks in first.

A typical design has at least one and often two resistors there, so it will depend on the maximum rating + resistors' size.

  • \$\begingroup\$ See my comment to Trevor answer if you also want to add something ;) \$\endgroup\$ – zupazt3 Apr 1 '17 at 17:32

The important thing is the volume of current. You cannot exceed that too. So you definitely cannot use 10V source with higher current capability.
It's important to use input resistor to limit the current.

  • \$\begingroup\$ What do you mean by "volume of current"? The integrated current (charge)? Or just the current? Or something else? \$\endgroup\$ – Peter Mortensen Apr 11 '17 at 10:52
  • \$\begingroup\$ @PeterMortensen by "current" I simply mean current in amperes. Zener diodes have maximum allowed current. \$\endgroup\$ – Chupacabras Apr 11 '17 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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