I always see this circuit when talking about overvoltage or ESD protection (does this circuit accomplish both, or just one?):
However, I don't understand how it works. Say I put in 20V at Vpin.
So Vpin is at a higher potential than Vdd, so current flows through the diode. But the voltage at the node Vpin is still 20V and the IC still sees 20V - how does this protect the internal circuitry? Furthermore, if an ESD event hit 10,000V to Vpin how does it protect the internal circuitry?
Finally, is the diode D2 there to protect against a voltage below Vss, or does it have some other purpose?
I have tried simulating this circuit, but for some reason it does not work.