Constant voltage on unpowered but grounded microcontroller - Page 1
Forum section: electronics / projects

author: pyrohaz
author_rank: Regular Contributor
timestamp: January 03, 2015, 10:31:25 pm
content: Hey all,I'm wondering if there will be any form of damage on the inputs of my microcontroller if I provide a voltage when the microcontroller is unpowered.I'm thinking of putting 5v on a microcontroller input (5v tolerant ofc!) through a large resistor (1M Ohm) which will always be present regardless of whether the microcontroller is powered. Obviously, the microcontroller will have internal protection diodes which will sink this voltage but with such a small current, can this cause damage?

author: Psi
author_rank: Super Contributor
timestamp: January 03, 2015, 10:36:30 pm
content: Without the 1M resistor i would be worried, 5v tolerant i/o is only tolerant while the chip is powered.However, with a 1M series resistor we're talking 5uA so it will be fine.

author: pyrohaz
author_rank: Regular Contributor
timestamp: January 03, 2015, 11:19:52 pm
content: Quote from: Psi on January 03, 2015, 10:36:30 pmPerfect! Thanks a lotOther than latch up, is there any other effect present from a constant voltage on an unpowered chip?

author: richard.cs
author_rank: Super Contributor
timestamp: January 03, 2015, 11:29:49 pm
content: Driving current into the protection diodes of an operating chip can cause latchup if the currents are high, small currents can mess with ADC performance. On an unpowered chip none of that matters and you just have to keep the current to a safe level, with a 1M resistor it'll be fine operating or not but expect to see the vcc pin float to around 2V.I've seen ugly designs where a PIC has its gnd tied to mains neutral, an input to live via a few hundred kiloohms and a zener and capacitor from vcc to ground. That input pin both detects mains zero crossings and powers the chip. Pretty awful but it does work.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 04, 2015, 12:45:47 am
content: How much leakage is in the power supply? Will it be accidentally powered by the microamperes?

author: PChi
author_rank: Frequent Contributor
timestamp: January 04, 2015, 12:50:51 pm
content: It can lead to weird behaviour. Can't you add a circuit to block the voltage? Some of the Logic Gate families can take input voltages when they are not powered.Some or perhaps all of the STM32 '5V tolerant' inputs are only tolerant when they are powered up. They don't include input protection diodes from the input to supply.

author: pyrohaz
author_rank: Regular Contributor
timestamp: January 04, 2015, 05:01:45 pm
content: Quote from: richard.cs on January 03, 2015, 11:29:49 pmThat sounds really fun if you've got connect the plug the wrong way round (not possible in the UK but still)!Quote from: T3sl4co1l on January 04, 2015, 12:45:47 amWell I'm using one of the Microchip TC1185 regulators (at 3v) with the shutdown pin being used to enable/disable the circuit. I don't think the reverse current could really cause that much of a problem though I'm not really sure how the internals of these regulators work with regards to the current state of the enable pin.Quote from: PChi on January 04, 2015, 12:50:51 pmI'm a little space limited so adding an extra bit of circuitry is a bit impractical! For future reference though, what families allow for this?Do you have any sources on how the inputs are 5v tolerant? I wouldn't expect them to have the protection diodes because if they did, current would always be sank into the main supply.

author: PChi
author_rank: Frequent Contributor
timestamp: January 04, 2015, 08:08:50 pm
content: I think that the Texas Instruments LVC (there are other families) range can survive up to 6.5 V on the input or output when they are in the 'power off' state. I don't know the details but as you say they can't include simple protection diodes but must have some protection to survive ESD.

author: dannyf
author_rank: Super Contributor
timestamp: January 04, 2015, 09:52:51 pm
content: QuoteGenerally speaking, not a good idea. Many of the modern MCUs take very little to power - some can be even powered by fruit for example.Unless you know for sure that the resulting voltage on the mcu's supply side cannot get enough to turn on the mcu, even unreliably, I wouldn't do that.

author: pyrohaz
author_rank: Regular Contributor
timestamp: January 05, 2015, 01:41:14 am
content: Quote from: dannyf on January 04, 2015, 09:52:51 pmWould it be better for me to connect the 5v to the microcontroller through a potential divider as opposed to forcing the micro to potentially sink the current?

author: jmole
author_rank: Regular Contributor
timestamp: January 05, 2015, 04:50:36 am
content: Quote from: pyrohaz on January 05, 2015, 01:41:14 amwon't really work that way, unless the lower half of the divider is also a diode. The current will follow the path of least resistance, which will be the protection diode, unless you have another diode in parallel, or a very low value resistor.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 05, 2015, 04:53:09 am
content: Quote from: pyrohaz on January 04, 2015, 05:01:45 pmNonono, that's not what I meant, that's exactly theforwardthinking that gets one into problems here! You're applying powerbackwards, what then?How much current draw must the regulator supply? What kind of loads are in the circuit? Is it just an MCU, or is there analog or other digital (CMOS or ??) around? Any pulldown resistors?Point being, if the regulator is off, how far will the supply voltage drop down to, and will it stay "off" when you put 5uA back into it?Trick is, CMOS logic (including MCUs) draw very little current when inactive, so you could very well run into a situation where that 5uA charges the power supply, the MCU magically activates, then the increased current consumption drags it down, and up and down it goes. Whether this produces aberrant behavior, who knows -- MCUs take quite a bit of time to start up, so the port pins may not even become active (reading or writing), let alone the firmware booting, in that time.A good tip is to use an external reset generator IC, which keeps the MCU (and any other stateful devices) in reset at low voltages.Another option / way to look at it: when you turn off your regulator, you're not forcing the supply to zero, you're leaving it to its own devices. If it were a reference type regulator, it could sink as well as source voltage, and then you'd have this behavior. But those don't really exist, I think.Suppose you put a pull-down FET in there, so when the regulator is off, the supply is actively shunted -- now you get that kind of action, in a crude but sufficient way. You'll have absolutely no worries at all about pin input currents, because it's shunted to ground. Have the transistor turn on slowly, so it dissipates the supply gradually, giving time for the regulator to turn off, and limit its current with a resistor. Turn off the transistor quickly so the regulator doesn't try to drive a short on startup.Usually, there are enough 'dumb' loads (like bias resistors and pull-ups/downs) that such drastic measures aren't necessary. Just a matter of inspecting your circuit, and considering what all the loads will (or may) do at low voltage.Tim

author: Mad ID
author_rank: Regular Contributor
timestamp: January 05, 2015, 08:41:14 am
content: Quote from: richard.cs on January 03, 2015, 11:29:49 pmHow much current flow through the protection diodes can cause a latch-up? I presume the latch-up would happen at the moment the power supply starts ramping up?Thanks

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 05, 2015, 07:39:15 pm
content: With modern CMOS processes, latchup is generally a >100mA range phenomenon. Too much duration of that (>100us?) and the input is smoked anyway, so they call them "free from latchup". And yes, you can't have latchup without sufficient voltage and current from the supply.For practical purposes, keeping input diode current under 10mA (as a continuous/repetitive peak rating) is prudent. As mentioned, there may be other reasons to keep it even lower, like sensitive analog stuff that's not properly guarded on chip.Tim