L
Larry Brasfield
- Jan 1, 1970
- 0
Cauley Felps said:Hi, Hi.
I'm building a PIC-based MIDI timecode LED display from the web. I'm
mounting it in a small enclosure I have, and would like to use the
existing power switch (a SPST tactile button).
I found a schematic for latching power using 4 transistors here:
http://www.edn.com/article/CA472837.html ....
I'm open to any other suggestions on the power supply or latch
circuit.
There is a somewhat simpler approach, at least from
a hardware perspective, when you have a general
purpose (micro)computer available.
Imagine you have these hardware elements:
1. An electronic switch to connect or disconnect
power from all of the circuit except as noted here.
2. A mechanical, momentary switch which, when
depressed, forces the electronic switch to be on.
3. A programmable system with an input by which
to read the state of the mechanical switch and an
output which can force the electronic switch on or
off, but which, as reset is asserted, does not force
the switch on or off. (An output that is tri-state by
default upon power-up or reset is easiest.)
Then, use this algorithm:
Upon power-up reset, wait until the mechanical
switch appears to be depressed for a time longer
than any normal bounce, then assert the output
that holds the electronic switch on. Monitor
the mechanical switch for non-depression, lasting
longer than a normal bounce, before beginning the
next step. Monitor the mechanical switch during
normal operation, (via interrupt or polling), often
enough to be able to notice subsequent depression.
Once depression is observed lasting longer than a
normal bounce, enter a pre-shutdown state where
all or most indications of power being on are not
displayed. In this state, wait for the mechanical
switch to be non-depressed for longer than a
normal bounce. Then negate the output holding
the electronic switch on.
This may seem involved, but it requires somewhat
less hardware than the article you cited.