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
why not use the reset pin?
RA3, MCLR for pics, pulling him low resets the device unless you have set the fuses to use it as an input.
Aah, ok. Unfortunately I'm using it as an input.
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.
Great, thank you. I will pull all the inputs low, then pull vdd low.
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".
Dave his a video on the EEVBLOG 831
This shows how you can power (unintentionally) a micro by pushing power into an input pun.
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.