<div dir="ltr"><div class="gmail_extra">Pololu has a device that lets you turn on an output (FET) and hold the output on until you turn it off with a digial I/O line. It is available off-the-shelf, small and $6. I have a vague recollection that Pololu received a patent on this product.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Pololu Pushbutton Power Switch LV, 2.5V - 7.0V </div><div class="gmail_extra"><a href="http://www.pololu.com/product/751">http://www.pololu.com/product/751</a></div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Instructable on using this item with Arduino.</div><div class="gmail_extra"><a href="http://www.instructables.com/id/Using-the-Pololu-Pushbutton-Power-Switch/">http://www.instructables.com/id/Using-the-Pololu-Pushbutton-Power-Switch/</a><br>
</div><div class="gmail_extra">Shane<br><br><div class="gmail_quote">On Thu, Apr 10, 2014 at 11:38 AM, Pete Soper <span dir="ltr"><<a href="mailto:pete@soper.us" target="_blank">pete@soper.us</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    In my browser the vertical bar from the cap is further to the right
    than you intended, but I think we get it.<br>
    <br>
    So the capacitor will be discharged by the mcu pin's input
    resistance in series with the resistor. I agree this should work
    wonderfully as long as the cap is made large enough to keep the
    voltage high "long enough." If the latching action is only needed
    for a minute or two then a conventional cap may work well. For a
    longer time a supercap might be required.  The MCU (or expander port
    chip) data sheet and the resistor value could be used to calculate
    the time constant. But that's for a perfect cap: the super caps will
    approach this, but regular electrolytics will discharge faster where
    the other resistance involved is very large.<br>
    <br>
    A key issue is whether the resistor helps or hurts. If the latch
    needs to stay valid for a couple days, for instance, then when the
    pin is set to output and driven to ground it could take a very long
    time to discharge the capacitor. The software also has to keep track
    of that discharge time, re-testing the pin to confirm it's
    discharged or ignoring the pin "long enough" to avoid being tricked
    by another button press happening too soon after the earlier one.<br>
    <br>
    So the size of the capacitor in relation to how long the "latching"
    must last as well as how fast the discharge has to go would allow
    judging whether this circuit would meet Brian's requirements.  But
    it surely wins the simplicity award!<br>
    <br>
    If two pins could be used a classic SR latch should work. This would
    be a pair of gates (such as two CMOS nor gates) where the pushbutton
    applies a potential to the "set" input and the mcu pin senses Q or Q
    bar and applies a potential to the "reset" input. Here's a <a href="http://en.wikipedia.org/wiki/Latch_%28electronics%29#SR_NOR_latch" target="_blank">description</a>.<span><font color="#888888"><br>

    <br>
    <br>
    -Pete</font></span><div><div><br>
    <br>
    <div>On 04/10/2014 09:31 AM, Bill Farrow
      wrote:<br>
    </div>
    <blockquote type="cite">
      <pre>I was wondering if there is a "tricky" way you could do this using
only a single pin, a capacitor, and a resistor.

When the push button connects it charges the capacitor. The MCU pin,
configured as an input, can read the state of the capacitor. When the
MCU wants to reset the latch it can change the pin to an output and
set it to 0 (low) which discharges the capacitor to ground via the
resistor.

Let's see how bad my ascii art is:

mcu pin --- resistor --- switch --- 3.3v
                             |
                       capacitor
                             |
                           GND

Bill

_______________________________________________
Triangle, NC Embedded Computing mailing list
<a href="mailto:TriEmbed@triembed.org" target="_blank">TriEmbed@triembed.org</a>
<a href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" target="_blank">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a>
TriEmbed web site: <a href="http://TriEmbed.org" target="_blank">http://TriEmbed.org</a>
</pre>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
Triangle, NC Embedded Computing mailing list<br>
<a href="mailto:TriEmbed@triembed.org" target="_blank">TriEmbed@triembed.org</a><br>
<a href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org" target="_blank">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
TriEmbed web site: <a href="http://TriEmbed.org" target="_blank">http://TriEmbed.org</a><br>
<br></blockquote></div><br></div></div>