EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: pyrohaz on January 03, 2015, 10:31:25 pm

Title: Constant voltage on unpowered but grounded microcontroller
Post by: pyrohaz on January 03, 2015, 10:31:25 pm
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?
Title: Re: Constant voltage on unpowered but grounded microcontroller
Post by: Psi on January 03, 2015, 10:36:30 pm
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.

Title: Re: Constant voltage on unpowered but grounded microcontroller
Post by: pyrohaz on January 03, 2015, 11:19:52 pm
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.

Perfect! Thanks a lot :) Other than latch up, is there any other effect present from a constant voltage on an unpowered chip?
Title: Re: Constant voltage on unpowered but grounded microcontroller
Post by: richard.cs on January 03, 2015, 11:29:49 pm
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.
Title: Re: Constant voltage on unpowered but grounded microcontroller
Post by: T3sl4co1l on January 04, 2015, 12:45:47 am
How much leakage is in the power supply?  Will it be accidentally powered by the microamperes?
Title: Re: Constant voltage on unpowered but grounded microcontroller
Post by: PChi on January 04, 2015, 12:50:51 pm
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.
Title: Re: Constant voltage on unpowered but grounded microcontroller
Post by: pyrohaz on January 04, 2015, 05:01:45 pm
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.

That sounds really fun if you've got connect the plug the wrong way round (not possible in the UK but still)!

How much leakage is in the power supply?  Will it be accidentally powered by the microamperes?

Well 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.

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.

I'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.
Title: Re: Constant voltage on unpowered but grounded microcontroller
Post by: PChi on January 04, 2015, 08:08:50 pm
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.
Title: Re: Constant voltage on unpowered but grounded microcontroller
Post by: dannyf on January 04, 2015, 09:52:51 pm
Quote
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.

Generally 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.
Title: Re: Constant voltage on unpowered but grounded microcontroller
Post by: pyrohaz on January 05, 2015, 01:41:14 am
Quote
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.

Generally 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.

Would 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?
Title: Re: Constant voltage on unpowered but grounded microcontroller
Post by: jmole on January 05, 2015, 04:50:36 am
Quote
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.

Generally 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.

Would 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?

won'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.
Title: Re: Constant voltage on unpowered but grounded microcontroller
Post by: T3sl4co1l on January 05, 2015, 04:53:09 am
Well 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.


Nonono, that's not what I meant, that's exactly the forward thinking that gets one into problems here!  You're applying power backwards, 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
Title: Re: Constant voltage on unpowered but grounded microcontroller
Post by: Mad ID on January 05, 2015, 08:41:14 am
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.

How 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
Title: Re: Constant voltage on unpowered but grounded microcontroller
Post by: T3sl4co1l on January 05, 2015, 07:39:15 pm
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