Silly question...
How do I make a pin sink current? I want to use a single pin to open a PNP transistor used as a power switch on the positive rail.
Do I set it as an input? Do I set it as an output then set it's low state? I guess the direct question - how do I programatically connect a pin to ground? I'd prefer a straight PBP solution.
And a follow-up question...
Is it safe to use this switch to actually drive the PIC? So the Pic is downstream, using a push button to temporarily "jump" the transistor, when the Pic boots up it begins to sink current from that transistor causing it to come open, then when the button is released, the Pic continues to operate as usual - essentially latching it's own supply open. When I want to power down, I make that pin stop sinking current which should shut down the Pic (after it's 10uF cap discharges) which should give it time to cleanly execute the last program statements - basically pulling its own power supply.
But the first question is most important... trail and error, but I'd feel better hearing the "right way" from someone who knows.
Thanks!
Bookmarks