EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: JoeP on November 06, 2018, 07:08:59 am

Title: Powering a microcontroller from an output pin of another microcontroller
Post by: JoeP on November 06, 2018, 07:08:59 am
I'm running out of pins on a microcontroller and need a way to turn off all its output pins from a single input pin. Could I use Vdd as this pin? Is there a reason why I shouldn't do this, and are there any issues this could cause? It would happen very infrequently, but for long periods of time. Would it damage the chip or will it be fine?
Thanks, Joe
Title: Re: Powering a microcontroller from an output pin of another microcontroller
Post by: Rerouter on November 06, 2018, 07:15:01 am
why not use the reset pin?
Title: Re: Powering a microcontroller from an output pin of another microcontroller
Post by: JoeP on November 06, 2018, 07:26:18 am
I don't know whether mine's got one? The datasheet is here: http://www.farnell.com/datasheets/2137994.pdf?_ga=2.11177268.1643568016.1539016190-2008006305.1520009189 (http://www.farnell.com/datasheets/2137994.pdf?_ga=2.11177268.1643568016.1539016190-2008006305.1520009189)
It says nothing about a reset pin though.
Title: Re: Powering a microcontroller from an output pin of another microcontroller
Post by: Rerouter on November 06, 2018, 07:37:40 am
RA3, MCLR for pics, pulling him low resets the device unless you have set the fuses to use it as an input.
Title: Re: Powering a microcontroller from an output pin of another microcontroller
Post by: JoeP on November 06, 2018, 07:44:07 am
Aah, ok. Unfortunately I'm using it as an input.
Title: Re: Powering a microcontroller from an output pin of another microcontroller
Post by: Ian.M on November 06, 2018, 08:30:00 am
It depends on your definition of 'turn off'.   If you disconnect Vdd from the supply then pull it down to 0V, the PIC will be off and all the I/O pins will effectively be pulled low via their upper internal protection diodes.  If you don't pull Vdd down, if any pin has more than about 2V feeding into it from any source, the MCU will probably continue to run (to some extent - normal operation *NOT* guaranteed), powered from its inputs via their protection diodes. 

If you need all pins Hi-Z, then you *NEED* that /MCLR pin available so you can hold the PIC in Reset (unless you monitor another input and set all other pins as input when its asserted in code).

If all I/Os low with Vdd pulled down doesn't meet your requirements, you'll either have to be more efficient in your pin usage, multiplexing some uses to free up a pin, or you'll need to go up to a 28 pin part with similar features.
Title: Re: Powering a microcontroller from an output pin of another microcontroller
Post by: JoeP on November 06, 2018, 05:35:01 pm
Great, thank you. I will pull all the inputs low, then pull vdd low.
Title: Re: Powering a microcontroller from an output pin of another microcontroller
Post by: brybot on November 06, 2018, 10:28:51 pm
Great, thank you. I will pull all the inputs low, then pull vdd low.

Beware, in that configuration your inputs may sink current through protection diodes. In that sense, they won't truly be "off".
Title: Re: Powering a microcontroller from an output pin of another microcontroller
Post by: JustMeHere on November 07, 2018, 01:38:23 am
Dave his a video on the EEVBLOG 831   https://www.youtube.com/watch?v=2yFh7Vv0Paw (https://www.youtube.com/watch?v=2yFh7Vv0Paw)

This shows how you can power (unintentionally) a micro by pushing power into an input pun.
Title: Re: Powering a microcontroller from an output pin of another microcontroller
Post by: TomS_ on November 07, 2018, 07:24:35 pm
I'm running out of pins on a microcontroller and need a way to turn off all its output pins from a single input pin.

Perhaps something like a 74HC245? Take pin 19 high and the output pins will go tri-state.