I have stm32 gpio pin connected through 5k resistor to the 12V supply. What voltage can I expect on the pin depending on the gpio configuration and processor model? Is there any internal clamping in the MCU?
Do I need external clamping diodes?
This is far beyond 5V tolerant I/Os of the datasheet guaranteed specifications... Usually a resistor divider should be applied to shift down the voltage.
This will destroy the pin, you must use the resistor divider as suggested above or use transistor signaling (preferred).
To answer your question:
The voltage will be shunted through a pin protection diode to Vcc,
This diode will conduct at 0.3- 0.6V until it heats up... and blows open
The pin will sit at Vcc + about 0.6v,,,,,,,,,,,, 0.7,,,,,, 0.8,,, 1v, 2v and pssssh the diode evaporates.
Now the pin is exposed to 12v at low current, the output Fet will fail and pssssh your pin is disconnected from the die.
Other than that you should be ok.
Is this behaviour different on 5V tolerant pins? I tried it on my F446RE on such pin in input state and noticed ~8V on the pin. Now it seems to work fine.
you must use the divider.. it is simple
2k ohm to uProcessor pin to 1k ohm to ground
Vout = 1/3 Vin = 4V max.
it will never fail.
8v pin will fail sometime.
Retrieving data ...