Microcontrollers and other digital IC's almost always include some circuitry to protect pins from static by draining away at least some current when the pin voltages would start to reach dangerous levels. Note that if there weren't any protection circuitry, and if a pin wouldn't leak at all until it failed catastrophically, even a picoamp flowing into a pin would be enough to destroy a chip (even a picoamp flowing into a chip will cause the voltage to increase until either there is some leakage or the part fails; in practice, many chips would start to leak more than a picoamp before the voltage was high enough to cause catastrophic failure). There are two general ways this can be accomplished:
- Design a pin so that when its voltage is significantly higher than VDD (more than ~0.3 volts), current will flow from that pin to VDD; if the pin gets more than ~0.7 volts over VDD, the current will increase markedly.
- Design a pin so that if its voltage gets too much above VSS (e.g. more than ~5.5 volts), current will flow to VSS.
The former style of protection is cheaper and more effective in cases where there is no need to run a pin above VDD. It will, however, mean that any pin which has voltage on it when VDD is not will attempt to power the device.
To see which style of protection a pin has, check the "Absolute Maximum Ratings" section of the data sheet. If a pin's maximum voltage is listed as something like VDD+0.3 volts, the pin cannot be used while the chip is unpowered. If it is listed as something like "VSS+5.5 volts" or simply "5.5 volts", then it may be possible to use the pin while the device is powered off.