STM32 clamping diodes - what is the maximum input voltage?

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}\$

schematic

simulate this circuit – Schematic created using CircuitLab


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. Say, STM32L082xx datasheet I/O current injection characteristics tells most pins can withstand up to 5mA worth of injected current without damaging the device.

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.


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.